From 97bc7d0cb0c5fa245b2736d51295d1da0d8311e0 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 11 Mar 2009 16:16:20 -0400 Subject: Fix calling setsid and resolve the sssd signal bug For some reason we were not testing for HAVE_SETSID in configure therefore the setsid() function was never called. This failed to set the process group after the first fork. Remove ifdef because we depend on setsid() anyway, so if it is not available on some platform it is better to fail rather then silently succeed but not have the right process group set up. --- server/util/server.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'server/util/server.c') diff --git a/server/util/server.c b/server/util/server.c index 86854cb72..0ae2b0a1f 100644 --- a/server/util/server.c +++ b/server/util/server.c @@ -79,18 +79,8 @@ void become_daemon(bool Fork) } } - /* detach from the terminal */ -#ifdef HAVE_SETSID + /* detach from the terminal */ setsid(); -#elif defined(TIOCNOTTY) - { - int i = open("/dev/tty", O_RDWR, 0); - if (i != -1) { - ioctl(i, (int) TIOCNOTTY, (char *)0); - close(i); - } - } -#endif /* HAVE_SETSID */ /* Close fd's 0,1,2. Needed if started by rsh */ close_low_fds(false); /* Don't close stderr, let the debug system -- cgit