summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdaemon/dexec.c3
-rw-r--r--libdaemon/dfork.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/libdaemon/dexec.c b/libdaemon/dexec.c
index e1d1910..b8f74c1 100644
--- a/libdaemon/dexec.c
+++ b/libdaemon/dexec.c
@@ -107,7 +107,8 @@ int daemon_exec(const char *dir, int *ret, const char *prog, ...) {
FD_ZERO(&fds);
FD_SET(p[0], &fds);
- FD_SET(sigfd = daemon_signal_fd(), &fds);
+ sigfd = daemon_signal_fd();
+ FD_SET(sigfd, &fds);
n = 0;
diff --git a/libdaemon/dfork.c b/libdaemon/dfork.c
index 2fa9f30..c84cb58 100644
--- a/libdaemon/dfork.c
+++ b/libdaemon/dfork.c
@@ -209,7 +209,7 @@ pid_t daemon_fork(void) {
signal(SIGTSTP, SIG_IGN);
setsid();
- setpgrp();
+ setpgid(0,0);
if ((tty_fd = open("/dev/tty", O_RDWR)) >= 0) {
ioctl(tty_fd, TIOCNOTTY, NULL);