From: Jérémie Galarneau Date: Tue, 4 Oct 2016 21:00:17 +0000 (-0400) Subject: Fix: honor negative (unlimited) app socket timeout X-Git-Tag: v2.9.0-rc1~40 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=28ce0ff234b384b2611179bd45bb8e37e2875f1a;p=lttng-tools.git Fix: honor negative (unlimited) app socket timeout Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 5e19f379f..1964fe0cc 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2195,10 +2195,12 @@ static void *thread_registration_apps(void *data) * lttcomm_setsockopt_snd_timeout expect msec as * parameter. */ - (void) lttcomm_setsockopt_rcv_timeout(sock, - app_socket_timeout * 1000); - (void) lttcomm_setsockopt_snd_timeout(sock, - app_socket_timeout * 1000); + if (app_socket_timeout >= 0) { + (void) lttcomm_setsockopt_rcv_timeout(sock, + app_socket_timeout * 1000); + (void) lttcomm_setsockopt_snd_timeout(sock, + app_socket_timeout * 1000); + } /* * Set the CLOEXEC flag. Return code is useless because