From d13606b9090ded5e986beae110162650e63b79c2 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 2 Jun 2011 13:20:05 -0400 Subject: [PATCH] kconsumerd dying when sessiond shutdown cmd socket Signed-off-by: David Goulet --- kconsumerd/kconsumerd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- 2.34.1