diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-05-11 02:07:48 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-05-11 02:07:48 +0000 |
commit | 30894b282cfd799e5aa6026d5905c7cc41d9049b (patch) | |
tree | 3c42404303a0b0753dd9aee222f90b63f53f07e5 /usr.bin | |
parent | 41174b9509cd961e31acc18abed8627fcd4e1e7e (diff) |
If fork fails with EAGAIN, ignore errno and fail. Looping just
worsens the problem.
cloder@ and deraadt@ agree.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sendbug/sendbug.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c index e1299f16e41..bbb6c4b6307 100644 --- a/usr.bin/sendbug/sendbug.c +++ b/usr.bin/sendbug/sendbug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendbug.c,v 1.48 2007/05/11 02:00:49 ray Exp $ */ +/* $OpenBSD: sendbug.c,v 1.49 2007/05/11 02:07:47 ray Exp $ */ /* * Written by Ray Lai <ray@cyth.net>. @@ -244,11 +244,8 @@ editit(const char *pathname) sighup = signal(SIGHUP, SIG_IGN); sigint = signal(SIGINT, SIG_IGN); sigquit = signal(SIGQUIT, SIG_IGN); - while ((pid = fork()) == -1) - if (errno == EAGAIN) - sleep(1); - else - goto fail; + if ((pid = fork()) == -1) + goto fail; if (pid == 0) { execv(_PATH_BSHELL, argp); _exit(127); |