From 4055611a53e8408c95a245d9612edb28b231c74c Mon Sep 17 00:00:00 2001 From: Sean Eric Fagan Date: Tue, 19 Nov 1996 03:32:32 +0000 Subject: [PATCH] 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 --- sbin/ping/ping.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 9262f5bdf27f..02b34fcec1be 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -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();