summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericj <ericj@openbsd.org>2001-01-16 20:20:48 +0000
committerericj <ericj@openbsd.org>2001-01-16 20:20:48 +0000
commit454bb281f733a5602bdef994311f4420d5fbac25 (patch)
treef1773526e4c97d4d135a897cd86a11f994c03aec
parentmatch on elsa xi300; from netbsd, no other visible changes in the driver (diff)
downloadwireguard-openbsd-454bb281f733a5602bdef994311f4420d5fbac25.tar.xz
wireguard-openbsd-454bb281f733a5602bdef994311f4420d5fbac25.zip
fix verbosity levels. pointed out by J.D. Carlson <jd@noc7.uchsc.edu>
-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);