diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-10-27 21:11:11 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-10-27 21:11:11 +0000 |
commit | 8f753cb54274cceba5865fd4e206073865f6e190 (patch) | |
tree | 6fe3ef1fba49660bb3dfeeb596fde023aecdf5d1 /t | |
parent | b7b35fc2ae6a316b9f0c068d7cb230b4c8fbc9f5 (diff) | |
download | perl-8f753cb54274cceba5865fd4e206073865f6e190.tar.gz |
Do not block if no message queues available.
p4raw-id: //depot/cfgperl@4473
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/ipc_sysv.t | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index 00a157ba54..9777292f37 100755 --- a/t/lib/ipc_sysv.t +++ b/t/lib/ipc_sysv.t @@ -77,8 +77,34 @@ if ($Config{'d_msgget'} eq 'define' && my $msgtype = 1; my $msgtext = "hello"; - msgsnd($msg,pack("L a*",$msgtype,$msgtext),0) or print "not "; + my $test2bad; + my $test5bad; + my $test6bad; + + unless (msgsnd($msg,pack("L a*",$msgtype,$msgtext),IPC_NOWAIT)) { + print "not "; + $test2bad = 1; + } print "ok 2\n"; + if ($test2bad) { + print <<EOM; +# +# The failure of the subtest #2 may indicate that the message queue +# resource limits either of the system or of the testing account +# have been reached. Error message "Operating would block" is +# usually indicative of this situation. The error message was now: +# "$!" +# +# You can check the message queues with the 'ipcs' command and +# you can remove unneeded queues with the 'ipcrm -q id' command. +# You may also consider configuring your system or account +# to have more message queue resources. +# +# Because of the subtest #2 failing also the substests #5 and #6 will +# very probably also fail. +# +EOM + } my $data; msgctl($msg,IPC_STAT,$data) or print "not "; @@ -88,13 +114,33 @@ if ($Config{'d_msgget'} eq 'define' && print "ok 4\n"; my $msgbuf; - msgrcv($msg,$msgbuf,256,0,IPC_NOWAIT) or print "not "; + unless (msgrcv($msg,$msgbuf,256,0,IPC_NOWAIT)) { + print "not "; + $test5bad = 1; + } print "ok 5\n"; + if ($test5bad && $test2bad) { + print <<EOM; +# +# This failure was to be expected because the subtest #2 failed. +# +EOM + } my($rmsgtype,$rmsgtext) = unpack("L a*",$msgbuf); - print "not " unless($rmsgtype == $msgtype && $rmsgtext eq $msgtext); + unless($rmsgtype == $msgtype && $rmsgtext eq $msgtext) { + print "not "; + $test6bad = 1; + } print "ok 6\n"; + if ($test6bad && $test2bad) { + print <<EOM; +# +# This failure was to be expected because the subtest #2 failed. +# +EOM + } } else { for (1..6) { print "ok $_\n"; # fake it |