Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-01-13 03:05:03 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2022-01-13 03:15:10 +0300
commit68b402ee51f12f8c3b11638b042f57e025359faf (patch)
treef7db9b14b44d89c448fd7d35cae821a97695f7f3 /loginutils
parentd162a7b978a98b910e410dc10a40d5de12db0419 (diff)
ash: ^C with SIG_INGed SIGINT should not exit the shell
function old new delta __pgetc 501 522 +21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/login.c4
-rw-r--r--loginutils/sulogin.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 569053c12..cac4349b2 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -608,7 +608,9 @@ int login_main(int argc UNUSED_PARAM, char **argv)
* But without this, bash 3.0 will not enable ctrl-c either.
* Maybe bash is buggy?
* Need to find out what standards say about /bin/login -
- * should we leave SIGINT etc enabled or disabled? */
+ * should we leave SIGINT etc enabled or disabled?
+ * Also note: sulogin does not do it! Why?
+ */
signal(SIGINT, SIG_DFL);
/* Exec login shell with no additional parameters */
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 5f1c1178f..2f87c77c0 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -111,6 +111,11 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv)
}
}
+ /*
+ * Note: login does this (should we do it too?):
+ */
+ /*signal(SIGINT, SIG_DFL);*/
+
/* Exec login shell with no additional parameters. Never returns. */
exec_login_shell(shell);
}