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>
Wed, 5 Oct 2016 22:38:07 +0000 (18:38 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index edf7f1b859bc38301fef9b59a50917de3fb52c09..d3ee890aece3de108b9bc80bbb8ff4d6252220cb 100644 (file)
@@ -2211,10 +2211,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.027372 seconds and 4 git commands to generate.