diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-03-30 22:13:55 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-03-30 22:13:55 +0000 |
commit | 02316e626f8087e2cd65632d94ea32f64e75a3f2 (patch) | |
tree | cde8c28fc127a3ee4d8981c4d573d5f9a1f6d177 /usr.sbin/tcpdump/tcpdump.c | |
parent | 1b3525e2e75a23c57869b3b54263d17ace8d9511 (diff) |
output final summary to stderr instead of stdout,
so it won't get mixed when tcpdump -w - is used.
ok henning@ deraadt@
Diffstat (limited to 'usr.sbin/tcpdump/tcpdump.c')
-rw-r--r-- | usr.sbin/tcpdump/tcpdump.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c index 780bec26e41..03e01cfa1ec 100644 --- a/usr.sbin/tcpdump/tcpdump.c +++ b/usr.sbin/tcpdump/tcpdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdump.c,v 1.43 2005/03/25 13:45:30 moritz Exp $ */ +/* $OpenBSD: tcpdump.c,v 1.44 2005/03/30 22:13:54 moritz Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -26,7 +26,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/tcpdump.c,v 1.43 2005/03/25 13:45:30 moritz Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/tcpdump.c,v 1.44 2005/03/30 22:13:54 moritz Exp $ (LBL)"; #endif /* @@ -570,14 +570,14 @@ cleanup(int signo) if (pcap_stats(pd, &stat) < 0) { (void)snprintf(buf, sizeof buf, "pcap_stats: %s\n", pcap_geterr(pd)); - write(STDOUT_FILENO, buf, strlen(buf)); + write(STDERR_FILENO, buf, strlen(buf)); } else { (void)snprintf(buf, sizeof buf, "%d packets received by filter\n", stat.ps_recv); - write(STDOUT_FILENO, buf, strlen(buf)); + write(STDERR_FILENO, buf, strlen(buf)); (void)snprintf(buf, sizeof buf, "%d packets dropped by kernel\n", stat.ps_drop); - write(STDOUT_FILENO, buf, strlen(buf)); + write(STDERR_FILENO, buf, strlen(buf)); } } _exit(0); |