summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2001-10-10 12:50:22 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2001-10-10 12:50:22 +0000
commitda2a979bccce928387e75c1f16d849d35660e1c6 (patch)
treefbb012b06521c0471d685db8074e188f8ed19413 /lib/libc/stdlib
parenta553409103de4f32b5a91fd1e0d3a5bd0b1ae5e0 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib')
-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 c7e68bae69b7..1e1761cc8675 100644
--- a/lib/libc/stdlib/system.c
+++ b/lib/libc/stdlib/system.c
@@ -50,7 +50,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;
@@ -83,8 +83,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;
}