summaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-03-07 06:36:27 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-03-07 06:36:27 -0800
commit4a03a56b463d01980c10192e76ed787d56408cd8 (patch)
treeb187c90a1a9e7792a999fd946bb33272e45956eb /socket.c
parenta3b0877584b9154bf5a5e2218e8ad07ea3c44ff3 (diff)
downloadtxr-4a03a56b463d01980c10192e76ed787d56408cd8.tar.gz
txr-4a03a56b463d01980c10192e76ed787d56408cd8.tar.bz2
txr-4a03a56b463d01980c10192e76ed787d56408cd8.zip
Show failing address in sock-connect error.
* socket.c (sock_connect): If connect fails, show socket and address in error message.
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/socket.c b/socket.c
index e4bbb61f..4e56334a 100644
--- a/socket.c
+++ b/socket.c
@@ -622,8 +622,8 @@ static val sock_connect(val sock, val sockaddr)
sockaddr_in(sockaddr, family, &sa, &salen);
if (connect(c_num(sfd), coerce(struct sockaddr *, &sa), salen) != 0)
- uw_throwf(socket_error_s, lit("sock-connect failed: ~d/~s"),
- num(errno), string_utf8(strerror(errno)), nao);
+ uw_throwf(socket_error_s, lit("sock-connect ~s to addr ~s: ~d/~s"),
+ sock, sockaddr, num(errno), string_utf8(strerror(errno)), nao);
sock_set_peer(sock, sockaddr);