Fix: handle negative range for LTTNG_UST_REGISTER_TIMEOUT
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 1e4bec699b4f454c0d01eef2749f6a7204e5f89d..f08e7b0698a83e1834c3c6dea2e2badb81b22bb0 100644 (file)
@@ -437,6 +437,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;
 }
 
@@ -1228,8 +1231,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.024482 seconds and 4 git commands to generate.