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:
Sean Eric Fagan 1996-11-19 03:32:32 +00:00
parent 5a0da0a5bc
commit 4055611a53
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19864

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