From: Mathieu Desnoyers Date: Fri, 2 Aug 2019 14:43:35 +0000 (-0400) Subject: Fix: don't wait for initial statedump when 0 session active X-Git-Tag: v2.11.0-rc4~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b8687c1ead598149bc02a9b68befd0c6f4c4fad6;p=lttng-ust.git Fix: don't wait for initial statedump when 0 session active commit eb0e6022d5e2 "Fix: wait for initial statedump before proceeding to the main program" introduced a regression when an application interacts with a session daemon which has 0 session active. An application linked against lttng-ust started with LTTNG_UST_REGISTER_TIMEOUT=-1 hangs forever. Fix this by decrementing the semaphore if no statedump was requested when the registration done command is received. Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 7d132ddc..bd9d0e9c 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -655,6 +655,10 @@ int handle_register_done(struct sock_info *sock_info) sock_info->registration_done = 1; decrement_sem_count(1); + if (!sock_info->statedump_pending) { + sock_info->initial_statedump_done = 1; + decrement_sem_count(1); + } return 0; }