summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-03-11 16:16:20 -0400
committerSimo Sorce <ssorce@redhat.com>2009-03-11 16:26:58 -0400
commit97bc7d0cb0c5fa245b2736d51295d1da0d8311e0 (patch)
treebb645223576fec1edc21b3f139deac5f34b3f028 /server
parent22ff503ab1a8b8fb76f759048e64c621e7560b31 (diff)
downloadsssd-97bc7d0cb0c5fa245b2736d51295d1da0d8311e0.tar.gz
sssd-97bc7d0cb0c5fa245b2736d51295d1da0d8311e0.tar.xz
sssd-97bc7d0cb0c5fa245b2736d51295d1da0d8311e0.zip
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.
Diffstat (limited to 'server')
-rw-r--r--server/util/server.c12
1 files changed, 1 insertions, 11 deletions
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