summaryrefslogtreecommitdiff
path: root/daemons
diff options
context:
space:
mode:
Diffstat (limited to 'daemons')
-rw-r--r--daemons/console-run.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/daemons/console-run.c b/daemons/console-run.c
index fb879e53..e1bfe642 100644
--- a/daemons/console-run.c
+++ b/daemons/console-run.c
@@ -217,8 +217,9 @@ open_console (char **namep)
dup2 (0, 1);
dup2 (0, 2);
- if (setsid () == -1)
- error (0, errno, "setsid");
+ if (getsid (0) != getpid ())
+ if (setsid () == -1)
+ error (0, errno, "setsid");
/* Set the console to our pgrp. */
tcsetpgrp (0, getpid ());