Fix: handle negative range for LTTNG_UST_REGISTER_TIMEOUT
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 726a30f9bdb6ffbfef4bc5fe17d11319ffdcd434..2ada5065f995a30fb517cc7c13331256b13a2fc1 100644 (file)
@@ -455,6 +455,9 @@ long get_timeout(void)
        }
        if (str_timeout)
                constructor_delay_ms = strtol(str_timeout, NULL, 10);
+       /* All negative values are considered as "-1". */
+       if (constructor_delay_ms < -1)
+               constructor_delay_ms = -1;
        return constructor_delay_ms;
 }
 
@@ -1246,8 +1249,9 @@ restart:
                         * deals with a killed or broken session daemon.
                         */
                        sleep(5);
+               } else {
+                       has_waited = 1;
                }
-               has_waited = 1;
                prev_connect_failed = 0;
        }
 
This page took 0.023382 seconds and 4 git commands to generate.