]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: replace siginterrupt with sigaction
authorChen Qi <Qi.Chen@windriver.com>
Mon, 31 Aug 2015 08:23:46 +0000 (16:23 +0800)
committerKarel Zak <kzak@redhat.com>
Mon, 31 Aug 2015 09:34:36 +0000 (11:34 +0200)
[kzak@redhat.com: - POSIX.1-2008 marks siginterrupt() as obsolete]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
login-utils/login.c

index 8d4b01b10ecf7e5b6adcfa88dce550a825f09b0b..0e45de7ac3d9b5a2155e09e4b76f491eb2322083 100644 (file)
@@ -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);