Changeset - 700ce9918794
[Not reviewed]
0 1 0
Jan Kaluza - 13 years ago 2012-10-30 12:09:23
hanzz.k@gmail.com
Close all sockets before fork()
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/networkpluginserver.cpp
Show inline comments
 
@@ -185,6 +185,11 @@ static unsigned long exec_(const std::string& exePath, const char *host, const c
 
	pid_t pid = fork();
 
	if ( pid == 0 ) {
 
		setsid();
 
		// close all files
 
		int maxfd=sysconf(_SC_OPEN_MAX);
 
		for(int fd=3; fd<maxfd; fd++) {
 
			close(fd);
 
		}
 
		// child process
 
		errno = 0;
 
		int ret = execv(argv[0], argv);
0 comments (0 inline, 0 general)