libdlogutil: allow sleeping forever 74/235674/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 8 Jun 2020 18:43:32 +0000 (20:43 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 8 Jun 2020 18:43:32 +0000 (20:43 +0200)
Change-Id: Iec35237c9a6ffbcf6b74f689675127617cbdddef
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/libdlogutil/logretrieve.c

index fe68f78..892dbd0 100644 (file)
@@ -345,6 +345,9 @@ static void set_flush_target(dlogutil_state_s *state, bool all_buffers_empty, lo
 
 static int get_timeout(dlogutil_state_s *state, int timeout, long last_log_age)
 {
+       if (sort_vector_empty(&state->logs))
+               return timeout;
+
        int max_timeout = state->logs.timeout - last_log_age;
        if (max_timeout < 0)
                return 0;