diff options
Diffstat (limited to 'libdaemon')
-rw-r--r-- | libdaemon/dfork.c | 4 | ||||
-rw-r--r-- | libdaemon/dpid.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/libdaemon/dfork.c b/libdaemon/dfork.c index 263c6f5..19e02a0 100644 --- a/libdaemon/dfork.c +++ b/libdaemon/dfork.c @@ -210,12 +210,12 @@ pid_t daemon_fork(void) { setsid(); setpgid(0,0); - +#ifdef TIOCNOTTY if ((tty_fd = open("/dev/tty", O_RDWR)) >= 0) { ioctl(tty_fd, TIOCNOTTY, NULL); close(tty_fd); } - +#endif dpid = getpid(); if (atomic_write(pipe_fds[1], &dpid, sizeof(dpid)) != sizeof(dpid)) goto fail; diff --git a/libdaemon/dpid.c b/libdaemon/dpid.c index c01ed0a..b2e113c 100644 --- a/libdaemon/dpid.c +++ b/libdaemon/dpid.c @@ -32,6 +32,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <time.h> +#include <sys/select.h> #include <fcntl.h> #include <stddef.h> |