Merge branch 'master' of github.com:hanzz/libtransport

This commit is contained in:
HanzZ 2012-10-30 18:06:41 +01:00
commit b20582ad36

View file

@ -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);