diff options
author | smart <smart@cvs.openbsd.org> | 2001-06-27 03:14:29 +0000 |
---|---|---|
committer | smart <smart@cvs.openbsd.org> | 2001-06-27 03:14:29 +0000 |
commit | 6c879563592b82691e2d131d06fccd79a1dcb27a (patch) | |
tree | 4b4ab6655c41ea61cda00ae15f93a2d9704b183f /usr.bin/nc | |
parent | 6848008d379ecd5a9c7099a058b4d963ea5524e3 (diff) |
Spit out errno message instead of just exitting. ericj@ ok.
Diffstat (limited to 'usr.bin/nc')
-rw-r--r-- | usr.bin/nc/netcat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index ecf392ceed1..a64d1563798 100644 --- a/usr.bin/nc/netcat.c +++ b/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.29 2001/06/27 02:45:08 smart Exp $ */ +/* $OpenBSD: netcat.c,v 1.30 2001/06/27 03:14:28 smart Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * @@ -189,7 +189,7 @@ main(argc, argv) /* Allow only one connection at a time, but stay alive */ for (;;) { if ((s = local_listen(host, uport, hints)) < 0) - exit(1); + err(1, NULL); /* * For UDP, we will use recvfrom() initially * to wait for a caller, then use the regular @@ -370,7 +370,7 @@ local_listen(host, port, hints) ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) - exit(1); + err(1, NULL); if (bind(s, (struct sockaddr *)res0->ai_addr, res0->ai_addrlen) == 0) |