summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorEric Jackson <ericj@cvs.openbsd.org>2001-01-16 20:20:49 +0000
committerEric Jackson <ericj@cvs.openbsd.org>2001-01-16 20:20:49 +0000
commitc1d10c9363a2b8ce926e22040749e97ac774c6c9 (patch)
tree8f85e2f1f60454e951c13d282e6fa34c91a0ec15 /usr.bin
parent614b3f68ba896d9b653d8ff0344d9ff5d3a84b0c (diff)
fix verbosity levels. pointed out by J.D. Carlson <jd@noc7.uchsc.edu>
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/nc/netcat.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index ac0968f37e1..73a8512d25c 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.18 2000/12/01 02:25:58 ericj Exp $ */
+/* $OpenBSD: netcat.c,v 1.19 2001/01/16 20:20:48 ericj Exp $ */
/* Netcat 1.10 RELEASE 960320
*
@@ -939,7 +939,7 @@ readwrite(fd)
netretry--; /* we actually try a coupla
* times. */
if (!netretry) {
- if (o_verbose) /* normally we don't
+ if (o_verbose > 1) /* normally we don't
* care */
nlog(0, "net timeout");
close(fd);
@@ -1296,7 +1296,7 @@ main(argc, argv)
if (o_zero && o_udpmode)
netfd = udptest(netfd, themaddr);
if (netfd > 0) {
- x = 0;
+ x = errno = 0;
if (o_verbose) {
nlog(0, "%s [%s] %d (%s) open",
whereto->name,
@@ -1307,7 +1307,7 @@ main(argc, argv)
x = readwrite(netfd);
} else {
x = 1;
- if ((Single || (o_verbose))
+ if ((Single || (o_verbose > 1))
|| (errno != ECONNREFUSED)) {
nlog(0, "%s [%s] %d (%s)",
whereto->name, whereto->addrs[0],
@@ -1324,8 +1324,9 @@ main(argc, argv)
}
optind++;
}
-
- nlog(0, "Sent %i Rcvd %i", wrote_net, wrote_out);
+ errno = 0;
+ if (o_verbose > 1)
+ nlog(0, "Sent %i Rcvd %i", wrote_net, wrote_out);
if (Single)
exit(x);
exit(0);