aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index 5c66ed5a..e7b9214b 100644
--- a/daemon.c
+++ b/daemon.c
@@ -127,8 +127,9 @@ daemonize (const char *logfile, void (*termhook)(int))
}
#elif defined(SIGTSTP) /* BSD */
/* change process group */
+#ifndef __EMX__
setpgrp(0, getpid());
-
+#endif
/* lose controlling tty */
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
ioctl(fd, TIOCNOTTY, (char *) 0);
@@ -136,7 +137,9 @@ daemonize (const char *logfile, void (*termhook)(int))
}
#else /* SVR3 and older */
/* change process group */
+#ifndef __EMX__
setpgrp();
+#endif
/* lose controlling tty */
signal(SIGHUP, SIG_IGN);