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:
sef 1996-11-19 03:32:32 +00:00
parent 950b3f70b1
commit 1f2dfe3791

View File

@ -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();