From 1f2dfe37918003708ea75a7172265b855bb07f7a Mon Sep 17 00:00:00 2001 From: sef Date: Tue, 19 Nov 1996 03:32:32 +0000 Subject: 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(-) (limited to 'sbin/ping') diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 9262f5b..02b34fc 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(); -- cgit v1.1