X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=kconsumerd%2Fkconsumerd.c;fp=kconsumerd%2Fkconsumerd.c;h=d14f68b4c2d87e5f2c166efed49ac41667f68ba8;hp=fd0b0b80cd6b19747fe6dcf7378504423e4dd3af;hb=d13606b9090ded5e986beae110162650e63b79c2;hpb=33a2b85433875769e92ca44a680c46b9498f5174 diff --git a/kconsumerd/kconsumerd.c b/kconsumerd/kconsumerd.c index fd0b0b80c..d14f68b4c 100644 --- a/kconsumerd/kconsumerd.c +++ b/kconsumerd/kconsumerd.c @@ -540,7 +540,6 @@ static void *thread_receive_fds(void *data) } if (tmp.cmd_type == STOP) { DBG("Received STOP command"); - quit = 1; goto end; } /* we received a command to add or update fds */ @@ -553,6 +552,11 @@ static void *thread_receive_fds(void *data) end: DBG("thread_receive_fds exiting"); + quit = 1; + ret = write(poll_pipe[1], "4", 1); + if (ret < 0) { + perror("poll pipe write"); + } return NULL; } @@ -671,6 +675,11 @@ static void *thread_poll_fds(void *data) goto end; } + /* No FDs and quit, cleanup the thread */ + if (nb_fd == 0 && quit == 1) { + goto end; + } + /* * if only the poll_pipe triggered poll to return just return to the * beginning of the loop to update the array