summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-03-07 07:55:56 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-03-07 07:55:56 +0000
commitc2d1caa53ea83c8b3a8992ee9c52b97719e0325c (patch)
tree9d5415cc89e3c85181f3d4647b4e69784c197dca
parentbdf20b3f76dd6389211e57fbc403521b05246cfe (diff)
Print error when connect() fails. ok markus@ deraadt@
-rw-r--r--usr.bin/nc/netcat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index f62612ad95e..0754001f8c2 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.70 2004/03/03 06:50:13 deraadt Exp $ */
+/* $OpenBSD: netcat.c,v 1.71 2004/03/07 07:55:55 mcbride Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
*
@@ -489,6 +489,9 @@ remote_connect(char *host, char *port, struct addrinfo hints)
if (connect(s, res0->ai_addr, res0->ai_addrlen) == 0)
break;
+ else if (vflag)
+ warn("connect to %s port %s (%s) failed", host, port,
+ uflag ? "udp" : "tcp");
close(s);
s = -1;