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.8.2~10 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9031b6b05822aaae4359cc622bcc2d30b1369f5f;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 c8e4e5386..fb659b7e0 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2243,10 +2243,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