summaryrefslogtreecommitdiffstats
path: root/sbin/ping
diff options
context:
space:
mode:
authorsef <sef@FreeBSD.org>1996-11-19 03:32:32 +0000
committersef <sef@FreeBSD.org>1996-11-19 03:32:32 +0000
commit1f2dfe37918003708ea75a7172265b855bb07f7a (patch)
treee687de5aa77871a49ce23accb6be47db3ea351e2 /sbin/ping
parent950b3f70b15cccf0525b1d84e812db418e0aa5eb (diff)
downloadFreeBSD-src-1f2dfe37918003708ea75a7172265b855bb07f7a.zip
FreeBSD-src-1f2dfe37918003708ea75a7172265b855bb07f7a.tar.gz
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
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c11
1 files changed, 6 insertions, 5 deletions
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();
OpenPOWER on IntegriCloud