=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/nc/netcat.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- src/usr.bin/nc/netcat.c 2000/12/01 02:25:58 1.18 +++ src/usr.bin/nc/netcat.c 2001/01/16 20:20:48 1.19 @@ -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 @@ 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 @@ 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 @@ 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 @@ } 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);