Mercurial > hg > toybox
comparison toys/other/login.c @ 1727:c0ef9b7976f0 draft
Use xsignal() instead of signal().
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 10 Mar 2015 11:07:28 -0500 |
parents | 41efba077b75 |
children |
comparison
equal
deleted
inserted
replaced
1726:26170eb7685d | 1727:c0ef9b7976f0 |
---|---|
154 if (geteuid()) error_exit("not root"); | 154 if (geteuid()) error_exit("not root"); |
155 | 155 |
156 if (!isatty(0) || !isatty(1) || !isatty(2)) error_exit("no tty"); | 156 if (!isatty(0) || !isatty(1) || !isatty(2)) error_exit("no tty"); |
157 | 157 |
158 openlog("login", LOG_PID | LOG_CONS, LOG_AUTH); | 158 openlog("login", LOG_PID | LOG_CONS, LOG_AUTH); |
159 signal(SIGALRM, login_timeout_handler); | 159 xsignal(SIGALRM, login_timeout_handler); |
160 alarm(TT.login_timeout = 60); | 160 alarm(TT.login_timeout = 60); |
161 | 161 |
162 for (ss = forbid; *ss; ss++) unsetenv(*ss); | 162 for (ss = forbid; *ss; ss++) unsetenv(*ss); |
163 | 163 |
164 while (1) { | 164 while (1) { |