From: Jarkko Hietaniemi Date: Tue, 5 Aug 2003 06:28:06 +0000 (+0000) Subject: [perl #23216] ext/IPC/SysV/t/sem.t don't remove semaphore on NetBSD sparc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cab0dcf91472885c5e694c5a5a9da5a38760ac49;p=p5sagit%2Fp5-mst-13.2.git [perl #23216] ext/IPC/SysV/t/sem.t don't remove semaphore on NetBSD sparc Try to remove the created message queues and semaphores even in the case of failures. p4raw-id: //depot/perl@20490 --- diff --git a/ext/IPC/SysV/t/msg.t b/ext/IPC/SysV/t/msg.t index fde699c..e9e241b 100755 --- a/ext/IPC/SysV/t/msg.t +++ b/ext/IPC/SysV/t/msg.t @@ -27,8 +27,9 @@ use IPC::Msg; print "1..9\n"; -$msq = new IPC::Msg(IPC_PRIVATE, S_IRWXU | S_IRWXG | S_IRWXO) - || die "msgget: ",$!+0," $!\n"; +my $msq = + new IPC::Msg(IPC_PRIVATE, S_IRWXU | S_IRWXG | S_IRWXO) + || die "msgget: ",$!+0," $!\n"; print "ok 1\n"; @@ -58,5 +59,7 @@ print "ok 7\n"; print "not " unless $ds && $ds->qnum() == 0; print "ok 8\n"; -$msq->remove || print "not "; -print "ok 9\n"; +END { + (defined $msq && $msq->remove) || print "not "; + print "ok 9\n"; +} diff --git a/ext/IPC/SysV/t/sem.t b/ext/IPC/SysV/t/sem.t index b3c813c..d506519 100755 --- a/ext/IPC/SysV/t/sem.t +++ b/ext/IPC/SysV/t/sem.t @@ -35,8 +35,9 @@ use IPC::Semaphore; print "1..10\n"; -$sem = new IPC::Semaphore(IPC_PRIVATE, 10, S_IRWXU | S_IRWXG | S_IRWXO | IPC_CREAT) - || die "semget: ",$!+0," $!\n"; +my $sem = + new IPC::Semaphore(IPC_PRIVATE, 10, S_IRWXU | S_IRWXG | S_IRWXO | IPC_CREAT) + || die "semget: ",$!+0," $!\n"; print "ok 1\n"; @@ -68,5 +69,7 @@ print "ok 8\n"; print "not " if $sem->getncnt(0); print "ok 9\n"; -$sem->remove || print "not "; -print "ok 10\n"; +END { + (defined $sem && $sem->remove) || print "not "; + print "ok 10\n"; +}