summaryrefslogtreecommitdiffstats
path: root/login-utils/login.c
diff options
context:
space:
mode:
authorChen Qi2015-08-31 10:23:46 +0200
committerKarel Zak2015-08-31 11:34:36 +0200
commit1b76608ef83d79ccba4b8f4f5eb2a50cf48b9519 (patch)
treeffdf5abdfd03c3b4d5ca88a4378e54a191935549 /login-utils/login.c
parentbuild-sys: include errno.h instead of argp.h (diff)
downloadkernel-qcow2-util-linux-1b76608ef83d79ccba4b8f4f5eb2a50cf48b9519.tar.gz
kernel-qcow2-util-linux-1b76608ef83d79ccba4b8f4f5eb2a50cf48b9519.tar.xz
kernel-qcow2-util-linux-1b76608ef83d79ccba4b8f4f5eb2a50cf48b9519.zip
login: replace siginterrupt with sigaction
[kzak@redhat.com: - POSIX.1-2008 marks siginterrupt() as obsolete] Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Diffstat (limited to 'login-utils/login.c')
-rw-r--r--login-utils/login.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/login-utils/login.c b/login-utils/login.c
index 8d4b01b10..0e45de7ac 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -1127,6 +1127,7 @@ int main(int argc, char **argv)
char *buff;
int childArgc = 0;
int retcode;
+ struct sigaction act;
char *pwdbuf = NULL;
struct passwd *pwd = NULL, _pwd;
@@ -1145,7 +1146,9 @@ int main(int argc, char **argv)
timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT);
signal(SIGALRM, timedout);
- siginterrupt(SIGALRM, 1); /* we have to interrupt syscalls like ioctl() */
+ (void) sigaction(SIGALRM, NULL, &act);
+ act.sa_flags &= ~SA_RESTART;
+ sigaction(SIGALRM, &act, NULL);
alarm(timeout);
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, SIG_IGN);