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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19864
@ -176,11 +176,6 @@ main(argc, argv)
|
|||||||
setuid(getuid());
|
setuid(getuid());
|
||||||
|
|
||||||
preload = 0;
|
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)];
|
datap = &outpack[8 + sizeof(struct timeval)];
|
||||||
while ((ch = getopt(argc, argv, "QRc:dfh:i:l:np:qrs:v")) != EOF)
|
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(SIGALRM, catcher);
|
||||||
(void)signal(SIGINFO, status);
|
(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 */
|
while (preload--) /* fire off them quickies */
|
||||||
pinger();
|
pinger();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user