1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

pidfile: use set_close_on_exec()

this prevents a fd leak to child processes
This commit is contained in:
Andrew Tridgell 2011-11-30 15:18:54 +11:00 committed by Andrew Bartlett
parent 9f4c3da734
commit fae42c1f41

View File

@ -107,6 +107,8 @@ void pidfile_create(const char *piddir, const char *name)
exit(1);
}
set_close_on_exec(fd);
if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)==false) {
DEBUG(0,("ERROR: %s : fcntl lock of file %s failed. Error was %s\n",
name, pidFile, strerror(errno)));