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:
parent
9f4c3da734
commit
fae42c1f41
@ -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)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user