diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-03-25 23:18:57 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-03-25 23:18:57 +0000 |
commit | cf1c89a6efbf6d1089dc45629e2c43563cb67601 (patch) | |
tree | e20d5042fd8a77dba962c72cbed9a1866bec5335 /usr.bin/sendbug/sendbug.c | |
parent | 40f1708da38ae342f7b611c2924ccaebbb2a90c9 (diff) |
Save errno before calling signal().
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r-- | usr.bin/sendbug/sendbug.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c index d0af34cc752..4a03d2233e6 100644 --- a/usr.bin/sendbug/sendbug.c +++ b/usr.bin/sendbug/sendbug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendbug.c,v 1.15 2007/03/23 17:18:07 deraadt Exp $ */ +/* $OpenBSD: sendbug.c,v 1.16 2007/03/25 23:18:56 ray Exp $ */ /* * Written by Ray Lai <ray@cyth.net>. @@ -187,15 +187,17 @@ editit(char *tmpfile) (void)signal(SIGINT, SIG_IGN); (void)signal(SIGQUIT, SIG_IGN); if ((pid = fork()) < 0) { + int saved_errno = errno; + (void)signal(SIGHUP, SIG_DFL); (void)signal(SIGINT, SIG_DFL); (void)signal(SIGQUIT, SIG_DFL); - if (errno == EPROCLIM) { + if (saved_errno == EPROCLIM) { warnx("you have too many processes"); free(p); return(0); } - if (errno == EAGAIN) { + if (saved_errno == EAGAIN) { sleep(1); goto top; } |