Fix: handle 0 session case in ask new streams
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Aug 2015 12:16:37 +0000 (08:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Jan 2018 19:46:03 +0000 (14:46 -0500)
If all sessions are closed by the time we ask for new streams, we could
end up looping forever waiting for new streams, so we now check we are
still waiting for something before looping.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/lttng-live/lttng-live-comm.c

index 64fc81f6f40e34dba01ce23370cd58ab61c3776b..bcbb06aa2e0344c4baa5504a7a66964705951913 100644 (file)
@@ -594,7 +594,12 @@ restart:
                        nb_streams += ret;
                }
        }
-       ret = nb_streams;
+       if (ctx->session_ids->len == 0) {
+               /* All sessions are closed. */
+               ret = -1;
+       } else {
+               ret = nb_streams;
+       }
 
 end:
        return ret;
This page took 0.033396 seconds and 4 git commands to generate.