diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-03-07 07:55:56 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-03-07 07:55:56 +0000 |
commit | c2d1caa53ea83c8b3a8992ee9c52b97719e0325c (patch) | |
tree | 9d5415cc89e3c85181f3d4647b4e69784c197dca /usr.bin/nc | |
parent | bdf20b3f76dd6389211e57fbc403521b05246cfe (diff) |
Print error when connect() fails. ok markus@ deraadt@
Diffstat (limited to 'usr.bin/nc')
-rw-r--r-- | usr.bin/nc/netcat.c | 5 |
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; |