From ae6b53b51a631f9a2ae4e059f41143695179c108 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 11 May 2007 02:07:47 +0000 Subject: If fork fails with EAGAIN, ignore errno and fail. Looping just worsens the problem. cloder@ and deraadt@ agree. --- usr.bin/sendbug/sendbug.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'usr.bin/sendbug/sendbug.c') 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 . @@ -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); -- cgit v1.2.3-59-g8ed1b