From e5237a493b31dc8ce4e974609be0a5484f1d859a Mon Sep 17 00:00:00 2001 From: iedowse Date: Wed, 7 Apr 2004 18:48:11 +0000 Subject: Don't turn off the regular SIGINFO status information. The use of the NOKERNINFO flag only marginally de-clutters the output and has a number of unwanted side effects: o The kernel info might be what you want to see o ^T is left non-functional if ping is killed non-cleanly o "ping -q foo &" gets suspended on tty output Encouraged by: bde --- sbin/ping/ping.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'sbin/ping/ping.c') diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 8db4afe..613b9cc 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define INADDR_LEN ((int)sizeof(in_addr_t)) @@ -185,7 +184,6 @@ double tsum = 0.0; /* sum of all times, for doing average */ double tsumsq = 0.0; /* sum of all times squared, for std. dev. */ volatile sig_atomic_t finish_up; /* nonzero if we've been told to finish up */ -int reset_kerninfo; volatile sig_atomic_t siginfo_p; static void fill(char *, char *); @@ -216,7 +214,6 @@ main(argc, argv) struct ip *ip; struct msghdr msg; struct sigaction si_sa; - struct termios ts; size_t sz; u_char *datap, packet[IP_MAXPACKET]; char *ep, *source, *target, *payload; @@ -708,12 +705,6 @@ main(argc, argv) iov.iov_base = packet; iov.iov_len = IP_MAXPACKET; - if (tcgetattr(STDOUT_FILENO, &ts) != -1) { - reset_kerninfo = !(ts.c_lflag & NOKERNINFO); - ts.c_lflag |= NOKERNINFO; - tcsetattr(STDOUT_FILENO, TCSANOW, &ts); - } - if (preload == 0) pinger(); /* send the first ping */ else { @@ -1271,7 +1262,6 @@ check_status() static void finish() { - struct termios ts; (void)signal(SIGINT, SIG_IGN); (void)signal(SIGALRM, SIG_IGN); @@ -1299,10 +1289,6 @@ finish() "round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f ms\n", tmin, avg, tmax, sqrt(vari)); } - if (reset_kerninfo && tcgetattr(STDOUT_FILENO, &ts) != -1) { - ts.c_lflag &= ~NOKERNINFO; - tcsetattr(STDOUT_FILENO, TCSANOW, &ts); - } if (nreceived) exit(0); -- cgit v1.1