summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmart <>2001-06-27 03:14:28 +0000
committersmart <>2001-06-27 03:14:28 +0000
commit0891d6e7daa2cc7f8a18bbf489678e810828e124 (patch)
treeb8fda10a9b4e66de1d45f1374e60e76420b5127b /src
parentc39a65503215cb4a7a11f48597b0047b082b1882 (diff)
downloadopenbsd-0891d6e7daa2cc7f8a18bbf489678e810828e124.tar.gz
openbsd-0891d6e7daa2cc7f8a18bbf489678e810828e124.tar.bz2
openbsd-0891d6e7daa2cc7f8a18bbf489678e810828e124.zip
Spit out errno message instead of just exitting. ericj@ ok.
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/nc/netcat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c
index ecf392ceed..a64d156379 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.29 2001/06/27 02:45:08 smart Exp $ */ 1/* $OpenBSD: netcat.c,v 1.30 2001/06/27 03:14:28 smart Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> 3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
4 * 4 *
@@ -189,7 +189,7 @@ main(argc, argv)
189 /* Allow only one connection at a time, but stay alive */ 189 /* Allow only one connection at a time, but stay alive */
190 for (;;) { 190 for (;;) {
191 if ((s = local_listen(host, uport, hints)) < 0) 191 if ((s = local_listen(host, uport, hints)) < 0)
192 exit(1); 192 err(1, NULL);
193 /* 193 /*
194 * For UDP, we will use recvfrom() initially 194 * For UDP, we will use recvfrom() initially
195 * to wait for a caller, then use the regular 195 * to wait for a caller, then use the regular
@@ -370,7 +370,7 @@ local_listen(host, port, hints)
370 370
371 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); 371 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
372 if (ret == -1) 372 if (ret == -1)
373 exit(1); 373 err(1, NULL);
374 374
375 if (bind(s, (struct sockaddr *)res0->ai_addr, 375 if (bind(s, (struct sockaddr *)res0->ai_addr,
376 res0->ai_addrlen) == 0) 376 res0->ai_addrlen) == 0)