summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-12-02 20:38:36 +0000
committermillert <millert@openbsd.org>2004-12-02 20:38:36 +0000
commit5d75915846059bcefec9a1fd48c6eea67d3e4ffc (patch)
treef03b5f8663712d8afe26ba1eb7f1c5b5ce43e926
parentoption DISABLE_EXT_CACHE is not used anymore. (diff)
downloadwireguard-openbsd-5d75915846059bcefec9a1fd48c6eea67d3e4ffc.tar.xz
wireguard-openbsd-5d75915846059bcefec9a1fd48c6eea67d3e4ffc.zip
Restart waitpid() if we are interupted by a signal. OK deraadt@
-rw-r--r--lib/libc/gen/auth_subr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 75a547195cc..ae34c02c078 100644
--- a/lib/libc/gen/auth_subr.c
+++ b/lib/libc/gen/auth_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth_subr.c,v 1.29 2004/08/30 18:14:33 millert Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.30 2004/12/02 20:38:36 millert Exp $ */
/*
* Copyright (c) 2000-2002,2004 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -877,7 +877,10 @@ auth_call(auth_session_t *as, char *path, ...)
_auth_spool(as, pfd[0]);
close(pfd[0]);
status = 0;
- if (waitpid(pid, &status, 0) < 0) {
+ do {
+ pid = waitpid(pid, &status, 0);
+ } while (pid < 0 && errno == EINTR);
+ if (pid < 0) {
if (errno != ECHILD) {
syslog(LOG_ERR, "%s: waitpid: %m", path);
_warnx("internal failure");