X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet6.c;h=1fd18a96258382e408df8c30fe8e250b456cd11d;hb=79445cf0e236eb0f9c08ed535f719994b68632aa;hp=1413c35172a32bfda2293bbe8aae6fd8acba6c1a;hpb=389fbf04b41e2002be44a1e3392bfade2f1deeef;p=lttng-tools.git diff --git a/src/common/sessiond-comm/inet6.c b/src/common/sessiond-comm/inet6.c index 1413c3517..1fd18a962 100644 --- a/src/common/sessiond-comm/inet6.c +++ b/src/common/sessiond-comm/inet6.c @@ -30,11 +30,10 @@ #include #include +#include #include "inet6.h" -#define MSEC_PER_SEC 1000 -#define NSEC_PER_MSEC 1000000 #define RECONNECT_DELAY 200 /* ms */ /* @@ -175,6 +174,9 @@ 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. @@ -201,12 +203,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; } }