about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-27 11:43:28 +0000
committerEric Wong <normalperson@yhbt.net>2011-02-27 11:43:28 +0000
commita589cb81d02ce77fa7c7a027328a2cf714878773 (patch)
tree3166812548db72e62480e383bd14bf59f43cd5c7
parent89c26cdaf25463c891a8ce915fefa1a181b3ac64 (diff)
downloadruby_posix_mq-a589cb81d02ce77fa7c7a027328a2cf714878773.tar.gz
In case somebody made the receiving pipe non-blocking,
we want the command-line tool to succeed.
-rwxr-xr-xbin/posix-mq-rb6
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" \