Hi,
When netcat is started with -Uz, the exit status is always 1. If
the unix connect is successful, netcat should exit with 0 and close
the socket.
ok?
bluhm
Index: usr.bin/nc/netcat.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.bin/nc/netcat.c,v
retrieving revision 1.176
diff -u -p -r1.176 netcat.c
--- usr.bin/nc/netcat.c 9 Feb 2017 20:14:41 -0000 1.176
+++ usr.bin/nc/netcat.c 9 Feb 2017 21:17:59 -0000
@@ -597,8 +597,9 @@ main(int argc, char *argv[])
} else if (family == AF_UNIX) {
ret = 0;
- if ((s = unix_connect(host)) > 0 && !zflag) {
- readwrite(s, NULL);
+ if ((s = unix_connect(host)) > 0) {
+ if (!zflag)
+ readwrite(s, NULL);
close(s);
} else
ret = 1;