Move the terminal handling code to a later location; this allows
the signal handlers to be set up; it also means that a failed name lookup won't mess up the nokerninfo setting of the tty. Reviewed by: pst, nate
This commit is contained in:
parent
5a0da0a5bc
commit
4055611a53
@ -176,11 +176,6 @@ main(argc, argv)
|
||||
setuid(getuid());
|
||||
|
||||
preload = 0;
|
||||
if (tcgetattr(STDOUT_FILENO, &ts) != -1) {
|
||||
reset_kerninfo = !(ts.c_lflag & NOKERNINFO);
|
||||
ts.c_lflag |= NOKERNINFO;
|
||||
tcsetattr(STDOUT_FILENO, TCSANOW, &ts);
|
||||
}
|
||||
|
||||
datap = &outpack[8 + sizeof(struct timeval)];
|
||||
while ((ch = getopt(argc, argv, "QRc:dfh:i:l:np:qrs:v")) != EOF)
|
||||
@ -361,6 +356,12 @@ main(argc, argv)
|
||||
(void)signal(SIGALRM, catcher);
|
||||
(void)signal(SIGINFO, status);
|
||||
|
||||
if (tcgetattr(STDOUT_FILENO, &ts) != -1) {
|
||||
reset_kerninfo = !(ts.c_lflag & NOKERNINFO);
|
||||
ts.c_lflag |= NOKERNINFO;
|
||||
tcsetattr(STDOUT_FILENO, TCSANOW, &ts);
|
||||
}
|
||||
|
||||
while (preload--) /* fire off them quickies */
|
||||
pinger();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user