Fix: honor negative (unlimited) app socket timeout
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 4 Oct 2016 21:00:17 +0000 (17:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 4 Oct 2016 21:00:17 +0000 (17:00 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index 5e19f379fbb05675a7d809d7878caa39c5c82b18..1964fe0cca3b80e57b8293d00aa12cfb92d18790 100644 (file)
@@ -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
This page took 0.028234 seconds and 4 git commands to generate.