diff options
author | ericj <> | 2001-01-16 20:20:48 +0000 |
---|---|---|
committer | ericj <> | 2001-01-16 20:20:48 +0000 |
commit | e2b9dee795e3d90b3746c6d4992df17619b5531f (patch) | |
tree | e4e2c0d831cf6ac1b366ec56f56dd8cc688eecfc /src/usr.bin | |
parent | e6c72dc13e265a35b23f128cfbbc96c6a9d901ec (diff) | |
download | openbsd-e2b9dee795e3d90b3746c6d4992df17619b5531f.tar.gz openbsd-e2b9dee795e3d90b3746c6d4992df17619b5531f.tar.bz2 openbsd-e2b9dee795e3d90b3746c6d4992df17619b5531f.zip |
fix verbosity levels. pointed out by J.D. Carlson <jd@noc7.uchsc.edu>
Diffstat (limited to 'src/usr.bin')
-rw-r--r-- | src/usr.bin/nc/netcat.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index ac0968f37e..73a8512d25 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: netcat.c,v 1.18 2000/12/01 02:25:58 ericj Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.19 2001/01/16 20:20:48 ericj Exp $ */ |
2 | 2 | ||
3 | /* Netcat 1.10 RELEASE 960320 | 3 | /* Netcat 1.10 RELEASE 960320 |
4 | * | 4 | * |
@@ -939,7 +939,7 @@ readwrite(fd) | |||
939 | netretry--; /* we actually try a coupla | 939 | netretry--; /* we actually try a coupla |
940 | * times. */ | 940 | * times. */ |
941 | if (!netretry) { | 941 | if (!netretry) { |
942 | if (o_verbose) /* normally we don't | 942 | if (o_verbose > 1) /* normally we don't |
943 | * care */ | 943 | * care */ |
944 | nlog(0, "net timeout"); | 944 | nlog(0, "net timeout"); |
945 | close(fd); | 945 | close(fd); |
@@ -1296,7 +1296,7 @@ main(argc, argv) | |||
1296 | if (o_zero && o_udpmode) | 1296 | if (o_zero && o_udpmode) |
1297 | netfd = udptest(netfd, themaddr); | 1297 | netfd = udptest(netfd, themaddr); |
1298 | if (netfd > 0) { | 1298 | if (netfd > 0) { |
1299 | x = 0; | 1299 | x = errno = 0; |
1300 | if (o_verbose) { | 1300 | if (o_verbose) { |
1301 | nlog(0, "%s [%s] %d (%s) open", | 1301 | nlog(0, "%s [%s] %d (%s) open", |
1302 | whereto->name, | 1302 | whereto->name, |
@@ -1307,7 +1307,7 @@ main(argc, argv) | |||
1307 | x = readwrite(netfd); | 1307 | x = readwrite(netfd); |
1308 | } else { | 1308 | } else { |
1309 | x = 1; | 1309 | x = 1; |
1310 | if ((Single || (o_verbose)) | 1310 | if ((Single || (o_verbose > 1)) |
1311 | || (errno != ECONNREFUSED)) { | 1311 | || (errno != ECONNREFUSED)) { |
1312 | nlog(0, "%s [%s] %d (%s)", | 1312 | nlog(0, "%s [%s] %d (%s)", |
1313 | whereto->name, whereto->addrs[0], | 1313 | whereto->name, whereto->addrs[0], |
@@ -1324,8 +1324,9 @@ main(argc, argv) | |||
1324 | } | 1324 | } |
1325 | optind++; | 1325 | optind++; |
1326 | } | 1326 | } |
1327 | 1327 | errno = 0; | |
1328 | nlog(0, "Sent %i Rcvd %i", wrote_net, wrote_out); | 1328 | if (o_verbose > 1) |
1329 | nlog(0, "Sent %i Rcvd %i", wrote_net, wrote_out); | ||
1329 | if (Single) | 1330 | if (Single) |
1330 | exit(x); | 1331 | exit(x); |
1331 | exit(0); | 1332 | exit(0); |