On Sat, Sep 29, 2001 at 11:28:39PM +0100, David Taylor wrote:
[snip]
> IMO, the below patch is probably the best solution.

Yep, it also fixes the fact that the return value from wait4() needs
to be preserved, at least for the return statement of __system().

G'luck,
Peter

-- 
"yields falsehood, when appended to its quotation." yields falsehood, when appended to 
its quotation.

> > cvs diff: Diffing .
> > Index: system.c
> > ===================================================================
> > RCS file: /home/ncvs/src/lib/libc/stdlib/system.c,v
> > retrieving revision 1.7
> > diff -u -r1.7 system.c
> > --- system.c        2001/01/24 13:00:59     1.7
> > +++ system.c        2001/09/29 21:55:41
> > @@ -53,7 +53,7 @@
> >  __system(command)
> >     const char *command;
> >  {
> > -   pid_t pid;
> > +   pid_t pid, savedpid;
> >     int pstat;
> >     struct sigaction ign, intact, quitact;
> >     sigset_t newsigblock, oldsigblock;
> > @@ -86,8 +86,9 @@
> >             execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL);
> >             _exit(127);
> >     default:                        /* parent */
> > +           savedpid = pid;
> >             do {
> > -                   pid = _wait4(pid, &pstat, 0, (struct rusage *)0);
> > +                   pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0);
> >             } while (pid == -1 && errno == EINTR);
> >             break;
> >     }
> > 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to