X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmanage-apps.cpp;h=7698ea442feff54e2bc8902334f70f93d8270b98;hb=8a00688e1d58cc5a2e77eba206ff23bd6105130c;hp=f8297a6df82820a975bf514702d692de7057ba21;hpb=6b979fc6dd8c03ed8332bdef2915b9d6d3ecfd6a;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/manage-apps.cpp b/src/bin/lttng-sessiond/manage-apps.cpp index f8297a6df..7698ea442 100644 --- a/src/bin/lttng-sessiond/manage-apps.cpp +++ b/src/bin/lttng-sessiond/manage-apps.cpp @@ -43,12 +43,12 @@ static void cleanup_application_management_thread(void *data) */ static void *thread_application_management(void *data) { - int i, ret, pollfd, err = -1; + int i, ret, err = -1; ssize_t size_ret; - uint32_t revents, nb_fd; + uint32_t nb_fd; struct lttng_poll_event events; struct thread_notifiers *notifiers = (thread_notifiers *) data; - const int quit_pipe_read_fd = lttng_pipe_get_readfd( + const auto thread_quit_pipe_fd = lttng_pipe_get_readfd( notifiers->quit_pipe); DBG("[thread] Manage application started"); @@ -75,7 +75,7 @@ static void *thread_application_management(void *data) goto error; } - ret = lttng_poll_add(&events, quit_pipe_read_fd, LPOLLIN | LPOLLERR); + ret = lttng_poll_add(&events, thread_quit_pipe_fd, LPOLLIN | LPOLLERR); if (ret < 0) { goto error; } @@ -110,15 +110,19 @@ static void *thread_application_management(void *data) for (i = 0; i < nb_fd; i++) { /* Fetch once the poll data */ - revents = LTTNG_POLL_GETEV(&events, i); - pollfd = LTTNG_POLL_GETFD(&events, i); + const auto revents = LTTNG_POLL_GETEV(&events, i); + const auto pollfd = LTTNG_POLL_GETFD(&events, i); health_code_update(); - if (pollfd == quit_pipe_read_fd) { + /* Activity on thread quit pipe, exiting. */ + if (pollfd == thread_quit_pipe_fd) { + DBG("Activity on thread quit pipe"); err = 0; goto exit; - } else if (pollfd == notifiers->apps_cmd_pipe_read_fd) { + } + + if (pollfd == notifiers->apps_cmd_pipe_read_fd) { /* Inspect the apps cmd pipe */ if (revents & LPOLLIN) { int sock;