summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-24 11:30:02 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-24 11:30:02 +0000
commit810a8846b7517bd8d2a9274fd16145f165a989d4 (patch)
treef82723456123b1a49c3b50f62429b3fc61ce639a /server.c
parentf941d270ca52a7330736b75415dacf3b674513b5 (diff)
A couple of close-on-exec flags.
Diffstat (limited to 'server.c')
-rw-r--r--server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server.c b/server.c
index 81cd6950..877724fd 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.33 2007-10-24 11:21:29 nicm Exp $ */
+/* $Id: server.c,v 1.34 2007-10-24 11:30:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -105,6 +105,8 @@ server_start(char *path)
fatal("fcntl failed");
if (fcntl(fd, F_SETFL, mode|O_NONBLOCK) == -1)
fatal("fcntl failed");
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
+ fatal("fcntl failed");
if (daemon(1, 1) != 0)
fatal("daemon failed");