diff options
Diffstat (limited to 'daemons/console-run.c')
-rw-r--r-- | daemons/console-run.c | 5 |
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 ()); |