aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-05-11 00:00:52 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2014-05-11 00:00:52 +0200
commit539e2802ebd2680602de0a2c76069b7f555392d9 (patch)
tree9a26e2e784b9f34d309bb4c7939762b4501ed0b7
parent62a40a044805ea1be7bb01b3408a38292823297e (diff)
downloadbusybox-w32-539e2802ebd2680602de0a2c76069b7f555392d9.tar.gz
busybox-w32-539e2802ebd2680602de0a2c76069b7f555392d9.tar.bz2
busybox-w32-539e2802ebd2680602de0a2c76069b7f555392d9.zip
getty: explain when setsid() fails. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--loginutils/getty.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 0f060ae6c..4b1b73bef 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -556,6 +556,16 @@ int getty_main(int argc UNUSED_PARAM, char **argv)
556 // pid, getppid(), 556 // pid, getppid(),
557 // getsid(0), getpgid(0)); 557 // getsid(0), getpgid(0));
558 bb_perror_msg_and_die("setsid"); 558 bb_perror_msg_and_die("setsid");
559 /*
560 * When we can end up here?
561 * Example: setsid() fails when run alone in interactive shell:
562 * # getty 115200 /dev/tty2
563 * because shell's child (getty) is put in a new process group.
564 * But doesn't fail if shell is not interactive
565 * (and therefore doesn't create process groups for pipes),
566 * or if getty is not the first process in the process group:
567 * # true | getty 115200 /dev/tty2
568 */
559 } 569 }
560 /* Looks like we are already a session leader. 570 /* Looks like we are already a session leader.
561 * In this case (setsid failed) we may still have ctty, 571 * In this case (setsid failed) we may still have ctty,