diff options
author | 2007-05-06 04:50:26 +0000 | |
---|---|---|
committer | 2007-05-06 04:50:26 +0000 | |
commit | b2d874e6dec3b5f54d7c565703b8ec98aacbc7b3 (patch) | |
tree | 598f1d2031377bbba99630aa90bbbc7dcda8821a /usr.bin/sendbug/sendbug.c | |
parent | at least always print a new line, even if NOPSS (diff) | |
download | wireguard-openbsd-b2d874e6dec3b5f54d7c565703b8ec98aacbc7b3.tar.xz wireguard-openbsd-b2d874e6dec3b5f54d7c565703b8ec98aacbc7b3.zip |
Save and restore signals once instead of each time fork fails with
EAGAIN.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r-- | usr.bin/sendbug/sendbug.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c index 5cb53f8250c..1431f7fe2a2 100644 --- a/usr.bin/sendbug/sendbug.c +++ b/usr.bin/sendbug/sendbug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sendbug.c,v 1.43 2007/04/25 04:56:14 ray Exp $ */ +/* $OpenBSD: sendbug.c,v 1.44 2007/05/06 04:50:26 ray Exp $ */ /* * Written by Ray Lai <ray@cyth.net>. @@ -238,20 +238,20 @@ editit(const char *pathname) return (-1); argp[2] = p; - top: sighup = signal(SIGHUP, SIG_IGN); sigint = signal(SIGINT, SIG_IGN); sigquit = signal(SIGQUIT, SIG_IGN); + top: if ((pid = fork()) == -1) { int saved_errno = errno; - (void)signal(SIGHUP, sighup); - (void)signal(SIGINT, sigint); - (void)signal(SIGQUIT, sigquit); if (saved_errno == EAGAIN) { sleep(1); goto top; } + (void)signal(SIGHUP, sighup); + (void)signal(SIGINT, sigint); + (void)signal(SIGQUIT, sigquit); free(p); errno = saved_errno; return (-1); |