From: David Goulet Date: Thu, 2 Jun 2011 17:20:05 +0000 (-0400) Subject: kconsumerd dying when sessiond shutdown cmd socket X-Git-Tag: v2.0-pre1~91 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d13606b9090ded5e986beae110162650e63b79c2;p=lttng-tools.git kconsumerd dying when sessiond shutdown cmd socket Signed-off-by: David Goulet --- 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