summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/system.c
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2001-10-03 11:01:39 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2001-10-03 11:01:39 +0000
commit9c2ccf274162e95596786f88f4d07ec34c7768fd (patch)
tree0219a40db31f5dd59337537729af770f6b41f53c /lib/libc/stdlib/system.c
parenta7e53031f61e4998d0511f640414215cd68cff9c (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/system.c')
-rw-r--r--lib/libc/stdlib/system.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c
index 3b1645414069e..28c9617978caa 100644
--- a/lib/libc/stdlib/system.c
+++ b/lib/libc/stdlib/system.c
@@ -53,7 +53,7 @@ int
__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 @@ __system(command)
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;
}