summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-28 05:48:02 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-28 05:48:02 +0000
commitf77ff938b7774d45f106b0fa9d6b6a8bab176b72 (patch)
treee19b4d1ea291556c8e0d5e826b338df52f42d330 /src/or/connection.c
parent9449ff73368974db10ae05c64b13a9ff0a02f25f (diff)
downloadtor-f77ff938b7774d45f106b0fa9d6b6a8bab176b72.tar.gz
tor-f77ff938b7774d45f106b0fa9d6b6a8bab176b72.zip
remember; tor_socket_errno has side effects!
svn:r2997
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index a261210449..4b48844fa9 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -538,10 +538,11 @@ int connection_connect(connection_t *conn, char *address, uint32_t addr, uint16_
log_fn(LOG_DEBUG,"Connecting to %s:%u.",address,port);
if(connect(s,(struct sockaddr *)&dest_addr,sizeof(dest_addr)) < 0) {
- if(!ERRNO_IS_CONN_EINPROGRESS(tor_socket_errno(s))) {
+ int e = tor_socket_errno(s);
+ if(!ERRNO_IS_CONN_EINPROGRESS(e)) {
/* yuck. kill it. */
log_fn(LOG_INFO,"Connect() to %s:%u failed: %s",address,port,
- tor_socket_strerror(tor_socket_errno(s)));
+ tor_socket_strerror(e));
tor_close_socket(s);
return -1;
} else {