git.samba.org
/
gd
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6a73ad
)
s3-pidfile: set the close on exec flag for the created pidfiles.
author
Günther Deschner
<gd@samba.org>
Mon, 17 May 2010 16:22:37 +0000
(18:22 +0200)
committer
Günther Deschner
<gd@samba.org>
Tue, 18 May 2010 14:16:19 +0000
(16:16 +0200)
Guenther
source3/lib/pidfile.c
patch
|
blob
|
history
diff --git
a/source3/lib/pidfile.c
b/source3/lib/pidfile.c
index 2c52d12122060735d29b13bd0e31d5b316da8ddc..a3e39db7848382dfcf85bba17179d551eade14eb 100644
(file)
--- a/
source3/lib/pidfile.c
+++ b/
source3/lib/pidfile.c
@@
-145,6
+145,9
@@
void pidfile_create(const char *program_name)
}
/* Leave pid file open & locked for the duration... */
SAFE_FREE(name);
+
+ /* set the close on exec so that we don't leak the fd */
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
}
void pidfile_unlink(void)