From: Karel Zak Date: Fri, 30 Mar 2012 09:14:47 +0000 (+0200) Subject: login: correction in sig_handler() X-Git-Tag: v2.21.1~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c12cd13aba970006d68d0f2e8a27e68a165328f8;p=thirdparty%2Futil-linux.git login: correction in sig_handler() Reported-by: Avinesh Kumar Signed-off-by: Karel Zak --- diff --git a/login-utils/login.c b/login-utils/login.c index 4f448f8607..043eaa20a7 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -186,12 +186,12 @@ static void timedout(int sig __attribute__ ((__unused__))) */ static void sig_handler(int signal) { - if (child_pid) + if (child_pid) { + if (signal == SIGTERM) + signal = SIGHUP; /* because the shell often ignores SIGTERM */ kill(-child_pid, signal); - else + } else got_sig = 1; - if (signal == SIGTERM) - kill(-child_pid, SIGHUP); /* because the shell often ignores SIGTERM */ } /*