X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet.c;h=ed7f5dc165e1b3961a2f53ef3107a0f54db85472;hb=329f344308786acb81d8939eb8e1ad37307696c2;hp=84bee5bd99142970ece0b1e1a1e9c2a0be10c720;hpb=389fbf04b41e2002be44a1e3392bfade2f1deeef;p=lttng-tools.git diff --git a/src/common/sessiond-comm/inet.c b/src/common/sessiond-comm/inet.c index 84bee5bd9..ed7f5dc16 100644 --- a/src/common/sessiond-comm/inet.c +++ b/src/common/sessiond-comm/inet.c @@ -30,11 +30,10 @@ #include #include +#include #include "inet.h" -#define MSEC_PER_SEC 1000 -#define NSEC_PER_MSEC 1000000 #define RECONNECT_DELAY 200 /* ms */ /* @@ -177,6 +176,8 @@ int connect_with_timeout(struct lttcomm_sock *sock) goto success; } + DBG("Asynchronous connect for sock %d, performing polling with" + " timeout: %lums", sock->fd, timeout); /* * Perform poll loop following EINPROGRESS recommendation from * connect(2) man page. @@ -203,12 +204,15 @@ int connect_with_timeout(struct lttcomm_sock *sock) ret = getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, &optval, &optval_len); if (ret) { + PERROR("getsockopt"); goto error; } if (!optval) { connect_ret = 0; goto success; } else { + /* Get actual connect() errno from opt_val */ + errno = optval; goto error; } }