X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-comm.c;h=e2f94cfdd56de8fa2231e854d291c3c6f3d1c24d;hb=27fe9f21a757d7adf834a6334322a79cc19164ab;hp=1f60f86dcb4c4287b9690b7fcfd974fb960e5ab1;hpb=b869b5ae63308b47d929a7859623054e685c6332;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 1f60f86d..e2f94cfd 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -926,7 +926,6 @@ restart: } /* Register */ - timeout = get_notify_sock_timeout(); for (i = 0; i < 2; i++) { ret = ustcomm_connect_unix_sock(sock_info->sock_path); if (ret < 0) { @@ -942,33 +941,34 @@ restart: goto restart; } open_sock[i] = ret; - if (timeout > 0) { - ret = ustcomm_setsockopt_rcv_timeout(open_sock[i], - timeout); - if (ret < 0) { - WARN("Error setting socket receive timeout"); - } - ret = ustcomm_setsockopt_snd_timeout(open_sock[i], - timeout); - if (ret < 0) { - WARN("Error setting socket send timeout"); - } - } else if (timeout == -1) { - ret = fcntl(open_sock[i], F_SETFL, O_NONBLOCK); - if (ret < 0) { - WARN("Error setting socket to non-blocking"); - } - } else { - if (timeout != 0) { - WARN("Unsuppoorted timeout value %ld", - timeout); - } - } } sock_info->socket = open_sock[0]; sock_info->notify_socket = open_sock[1]; + timeout = get_notify_sock_timeout(); + if (timeout > 0) { + ret = ustcomm_setsockopt_rcv_timeout(sock_info->notify_socket, + timeout); + if (ret < 0) { + WARN("Error setting socket receive timeout"); + } + ret = ustcomm_setsockopt_snd_timeout(sock_info->notify_socket, + timeout); + if (ret < 0) { + WARN("Error setting socket send timeout"); + } + } else if (timeout == -1) { + ret = fcntl(sock_info->notify_socket, F_SETFL, O_NONBLOCK); + if (ret < 0) { + WARN("Error setting socket to non-blocking"); + } + } else { + if (timeout != 0) { + WARN("Unsuppoorted timeout value %ld", timeout); + } + } + /* * Create only one root handle per listener thread for the whole * process lifetime, so we ensure we get ID which is statically