From 3365b4123660b600293d3f9bd5054523f194b5b9 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Sun, 10 Jan 2010 23:27:41 +0100 Subject: [perl #71924] shmget/semget may return zero as valid id Documentation in perlipc thus fixed by using // instead of || --- pod/perlipc.pod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pod') diff --git a/pod/perlipc.pod b/pod/perlipc.pod index 962d10625d..25b310bb7b 100644 --- a/pod/perlipc.pod +++ b/pod/perlipc.pod @@ -1661,7 +1661,7 @@ Here's a small example showing shared memory usage. use IPC::SysV qw(IPC_PRIVATE IPC_RMID S_IRUSR S_IWUSR); $size = 2000; - $id = shmget(IPC_PRIVATE, $size, S_IRUSR|S_IWUSR) || die "$!"; + $id = shmget(IPC_PRIVATE, $size, S_IRUSR|S_IWUSR) // die "$!"; print "shm key $id\n"; $message = "Message #1"; @@ -1683,7 +1683,7 @@ Here's an example of a semaphore: use IPC::SysV qw(IPC_CREAT); $IPC_KEY = 1234; - $id = semget($IPC_KEY, 10, 0666 | IPC_CREAT ) || die "$!"; + $id = semget($IPC_KEY, 10, 0666 | IPC_CREAT ) // die "$!"; print "shm key $id\n"; Put this code in a separate file to be run in more than one process. -- cgit v1.2.1