summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-05-22 18:17:53 +0000
committermillert <millert@openbsd.org>2002-05-22 18:17:53 +0000
commit76bd1f9cba7895690aaf2210814989a10a4b8804 (patch)
treeeda11b09ffa1d6104cded15147052318ff1680d4
parentRemove pid file if sent SIGINT or SIGTERM before exiting. (diff)
downloadwireguard-openbsd-76bd1f9cba7895690aaf2210814989a10a4b8804.tar.xz
wireguard-openbsd-76bd1f9cba7895690aaf2210814989a10a4b8804.zip
Set close-on-exec flag for the socket cron selects on.
-rw-r--r--usr.sbin/cron/misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/cron/misc.c b/usr.sbin/cron/misc.c
index e0b89cb2a72..6f6ff4bd8ae 100644
--- a/usr.sbin/cron/misc.c
+++ b/usr.sbin/cron/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.16 2002/05/22 16:39:39 millert Exp $ */
+/* $OpenBSD: misc.c,v 1.17 2002/05/22 18:17:53 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
*/
@@ -21,7 +21,7 @@
*/
#if !defined(lint) && !defined(LINT)
-static char rcsid[] = "$OpenBSD: misc.c,v 1.16 2002/05/22 16:39:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: misc.c,v 1.17 2002/05/22 18:17:53 millert Exp $";
#endif
/* vix 26jan87 [RCS has the rest of the log]
@@ -795,6 +795,7 @@ open_socket()
log_it("CRON", getpid(), "DEATH", "can't set non-block");
exit(ERROR_EXIT);
}
+ (void) fcntl(sock, F_SETFD, 1);
if (!glue_strings(sun.sun_path, sizeof sun.sun_path, SPOOL_DIR,
CRONSOCK, '/')) {