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

@@ -421,9 +421,6 @@
/* Define to 1 if you have the `setrlimit64' function. */
#undef HAVE_SETRLIMIT64
/* Define to 1 if you have the `setsid' function. */
#undef HAVE_SETSID
/* Define to 1 if you have the `set_auth_parameters' function. */
#undef HAVE_SET_AUTH_PARAMETERS

2
configure vendored
View File

@@ -14571,7 +14571,7 @@ LIBS=$ac_save_LIBS
for ac_func in strchr strrchr memchr memcpy memset sysconf tzset \
strftime setrlimit initgroups fstat gettimeofday \
regcomp setlocale getaddrinfo setsid setenv vhangup \
regcomp setlocale getaddrinfo setenv vhangup \
mbr_check_membership setrlimit64
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`

View File

@@ -1914,7 +1914,7 @@ dnl
AC_FUNC_GETGROUPS
AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \
strftime setrlimit initgroups fstat gettimeofday \
regcomp setlocale getaddrinfo setsid setenv vhangup \
regcomp setlocale getaddrinfo setenv vhangup \
mbr_check_membership setrlimit64)
AC_CHECK_FUNCS(getline, [], [
AC_LIBOBJ(getline)

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

View File

@@ -835,23 +835,10 @@ exec_monitor(struct command_details *details, char *argv[], char *envp[],
* and the slave pty as the controlling terminal.
* This allows us to be notified when the child has been suspended.
*/
#ifdef HAVE_SETSID
if (setsid() == -1) {
warning("setsid");
goto bad;
}
#else
# ifdef TIOCNOTTY
n = open(_PATH_TTY, O_RDWR|O_NOCTTY);
if (n >= 0) {
/* Disconnect from old controlling tty. */
if (ioctl(n, TIOCNOTTY, NULL) == -1)
warning("cannot disconnect controlling tty");
close(n);
}
# endif
setpgrp(0, 0);
#endif
if (io_fds[SFD_SLAVE] != -1) {
#ifdef TIOCSCTTY
if (ioctl(io_fds[SFD_SLAVE], TIOCSCTTY, NULL) != 0)