summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoderick Schertler <roderick@gate.net>1997-02-16 23:19:12 -0500
committerChip Salzenberg <chip@atlantic.net>1997-02-18 13:22:00 +1200
commit3d2573a84a1aa655d5da58c57b3fc20e04d40f9f (patch)
tree0a56f3f58228309bd6aa5260abd4023ec043c9b8
parent77bb9b23081b62119e8fbe9f5655b8802e4537ae (diff)
downloadperl-3d2573a84a1aa655d5da58c57b3fc20e04d40f9f.tar.gz
Allow C<setpgrp $$>
Subject: Re: Perl question, re: POSIX setpgrp On Fri, 14 Feb 1997 16:31:53 GMT, Chris Vo <chrisv@on.bell.ca> 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: <pzraigyshr.fsf@eeyore.ibcinc.com>
-rw-r--r--pp_sys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 0be532fb77..098b64f097 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 );