remove setsid check, we require a POSIX system

This commit is contained in:
Todd C. Miller
2010-06-15 09:24:56 -04:00
parent c2f8d24f20
commit 54ffb19ccb
5 changed files with 2 additions and 28 deletions

View File

@@ -451,18 +451,8 @@ send_mail(const char *fmt, ...)
}
/* Daemonize - disassociate from session/tty. */
#ifdef HAVE_SETSID
if (setsid() == -1)
warning("setsid");
#else
setpgrp(0, 0);
# ifdef TIOCNOTTY
if ((fd = open(_PATH_TTY, O_RDWR, 0644)) != -1) {
ioctl(fd, TIOCNOTTY, NULL);
close(fd);
}
# endif
#endif
(void) chdir("/");
if ((fd = open(_PATH_DEVNULL, O_RDWR, 0644)) != -1) {
(void) dup2(fd, STDIN_FILENO);