diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-27 11:43:28 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-27 11:43:28 +0000 |
commit | a589cb81d02ce77fa7c7a027328a2cf714878773 (patch) | |
tree | 3166812548db72e62480e383bd14bf59f43cd5c7 | |
parent | 89c26cdaf25463c891a8ce915fefa1a181b3ac64 (diff) | |
download | ruby_posix_mq-a589cb81d02ce77fa7c7a027328a2cf714878773.tar.gz |
In case somebody made the receiving pipe non-blocking, we want the command-line tool to succeed.
-rwxr-xr-x | bin/posix-mq-rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/posix-mq-rb b/bin/posix-mq-rb index 288b4e3..8c77aea 100755 --- a/bin/posix-mq-rb +++ b/bin/posix-mq-rb @@ -101,14 +101,14 @@ begin exit when :receive buf, prio = mq.receive("", timeout) - $stderr.syswrite("priority=#{prio}\n") if priority - $stdout.syswrite(buf) + $stderr.write("priority=#{prio}\n") if priority + $stdout.write(buf) when :send ARGV << $stdin.read if ARGV.empty? ARGV.each { |msg| mq.send(msg, priority, timeout) } when :attr mq_attr = mq.attr - $stdout.syswrite( + $stdout.write( "flags=#{mq_attr.flags}\n" \ "maxmsg=#{mq_attr.maxmsg}\n" \ "msgsize=#{mq_attr.msgsize}\n" \ |