From: Roderick Schertler Date: Mon, 17 Feb 1997 04:19:12 +0000 (-0500) Subject: Allow C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d2573a84a1aa655d5da58c57b3fc20e04d40f9f;p=p5sagit%2Fp5-mst-13.2.git Allow C Subject: Re: Perl question, re: POSIX setpgrp On Fri, 14 Feb 1997 16:31:53 GMT, Chris Vo said: > >>> POSIX setpgrp can't take an argument at ./check_ntp line 21. > > where line 21 reads as: > setpgrp (0, $$); Replace that with just setpgrp; This does the same thing and will work on all systems. I think there's a bug here. Perl is expecting a pgrp arg of 0 to mean $$, but it doesn't allow an explicit $$. Even this seems a little odd, as on neither system I've got available at the moment is it mentioned that a 0 pgrp means getpid() (they both mention that a 0 pid means getpid(), though). p5p-msgid: --- diff --git a/pp_sys.c b/pp_sys.c index 0be532f..098b64f 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3048,7 +3048,7 @@ PP(pp_getpgrp) #ifdef BSD_GETPGRP value = (I32)BSD_GETPGRP(pid); #else - if (pid != 0) + if (pid != 0 && pid != getpid()) { DIE("POSIX getpgrp can't take an argument"); value = (I32)getpgrp(); #endif @@ -3078,7 +3078,7 @@ PP(pp_setpgrp) #ifdef BSD_SETPGRP SETi( BSD_SETPGRP(pid, pgrp) >= 0 ); #else - if ((pgrp != 0) || (pid != 0)) { + if ((pgrp != 0 && pgrp != getpid())) || (pid != 0 && pid != getpid())) { DIE("POSIX setpgrp can't take an argument"); } SETi( setpgrp() >= 0 );