summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-12-02 20:38:37 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-12-02 20:38:37 +0000
commit49a278df9d876e1154d633e5b34a8e557b12ba82 (patch)
treee4def7dfe5ea941f73f307721451f39a3349cfd9 /lib
parent18752abb7569c5584fa73928d717ec3e5d70d370 (diff)
Restart waitpid() if we are interupted by a signal. OK deraadt@
Diffstat (limited to 'lib')
-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");