From: Jarkko Hietaniemi Date: Mon, 28 Apr 2003 08:27:15 +0000 (+0000) Subject: SysV msg queues can be something hanging (witnessed in IRIX), X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ddc3217d4aaa98853c093e6ed327d581bfffaa03;p=p5sagit%2Fp5-mst-13.2.git SysV msg queues can be something hanging (witnessed in IRIX), so let's use IPC_NOWAIT. p4raw-id: //depot/perl@19358 --- diff --git a/ext/IPC/SysV/t/msg.t b/ext/IPC/SysV/t/msg.t index e20d93c..fde699c 100755 --- a/ext/IPC/SysV/t/msg.t +++ b/ext/IPC/SysV/t/msg.t @@ -35,8 +35,7 @@ print "ok 1\n"; #Putting a message on the queue $msgtype = 1; $msg = "hello"; -$msq->snd($msgtype,$msg,0) || print "not "; -print "ok 2\n"; +print $msq->snd($msgtype,$msg,IPC_NOWAIT) ? "ok 2\n" : "not ok 2 # $!\n"; #Check if there are messages on the queue $ds = $msq->stat() or print "not "; diff --git a/t/op/taint.t b/t/op/taint.t index 846e1fd..e6e1265 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -44,7 +44,7 @@ BEGIN { eval { require IPC::SysV }; unless ($@) { $ipcsysv++; - IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU)); + IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU IPC_NOWAIT)); } } } @@ -700,14 +700,14 @@ else { my $type_rcvd; if (defined $id) { - if (msgsnd($id, pack("l! a*", $type_sent, $sent), 0)) { - if (msgrcv($id, $rcvd, 60, 0, 0)) { + if (msgsnd($id, pack("l! a*", $type_sent, $sent), IPC_NOWAIT)) { + if (msgrcv($id, $rcvd, 60, 0, IPC_NOWAIT)) { ($type_rcvd, $rcvd) = unpack("l! a*", $rcvd); } else { - warn "# msgrcv failed\n"; + warn "# msgrcv failed: $!\n"; } } else { - warn "# msgsnd failed\n"; + warn "# msgsnd failed: $!\n"; } msgctl($id, IPC_RMID, 0) or warn "# msgctl failed: $!\n"; } else {