From a589cb81d02ce77fa7c7a027328a2cf714878773 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Feb 2011 11:43:28 +0000 Subject: [PATCH] posix-mq-rb: always prefer write-in-full behavior In case somebody made the receiving pipe non-blocking, we want the command-line tool to succeed. --- bin/posix-mq-rb | 6 +++--- 1 file 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" \ -- 2.11.4.GIT