diff options
author | 2007-05-11 02:07:47 +0000 | |
---|---|---|
committer | 2007-05-11 02:07:47 +0000 | |
commit | ae6b53b51a631f9a2ae4e059f41143695179c108 (patch) | |
tree | 4719c9a71ed6805189531933ecc2c123a3b77b6d /usr.bin/sendbug/sendbug.c | |
parent | Instead of returning -1 and setting errno to ECHILD if the editor (diff) | |
download | wireguard-openbsd-ae6b53b51a631f9a2ae4e059f41143695179c108.tar.xz wireguard-openbsd-ae6b53b51a631f9a2ae4e059f41143695179c108.zip |
If fork fails with EAGAIN, ignore errno and fail. Looping just
worsens the problem.
cloder@ and deraadt@ agree.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-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); |