summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-08-04 22:44:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-08-04 22:44:13 +0000
commit0591c8c712601ae6a1b02b441e1f985180cc4714 (patch)
treeb03e0ad802b3b42697e013dba7cf12ec893dbdc4 /lib
parent8985e75974a36706c74570a928ed3cf237ebc5a9 (diff)
If fork() fails, log/report the error *before* we close our fd's just
in case close(2) were to set errno.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/auth_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 43e10b9b4fe..32b1f309fea 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.11 2002/06/27 22:21:22 deraadt Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.12 2002/08/04 22:44:12 millert Exp $ */
/*-
* Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc.
@@ -814,10 +814,10 @@ auth_call(auth_session_t *as, char *path, ...)
switch (pid = fork()) {
case -1:
- close(pfd[0]);
- close(pfd[1]);
syslog(LOG_ERR, "%s: %m", path);
_warnx("internal resource failure");
+ close(pfd[0]);
+ close(pfd[1]);
goto fail;
case 0:
#define COMM_FD 3