Fix an fd leak in start_daemon

svn:r4508
This commit is contained in:
Nick Mathewson 2005-06-30 06:56:00 +00:00
parent 8fd197c687
commit 584a0ae397

View File

@ -1418,6 +1418,8 @@ void finish_daemon(const char *desired_cwd)
log_fn(LOG_ERR,"dup2 failed. Exiting.");
exit(1);
}
if (nullfd > 2)
close(nullfd);
write(daemon_filedes[1], &c, sizeof(char)); /* signal success */
close(daemon_filedes[1]);
}