From: David Goulet Date: Tue, 6 Sep 2011 21:14:47 +0000 (-0400) Subject: Merge branch 'master' into benchmark X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=73c251ae38aee62c5f71e26a62db54d69b4b9269;hp=85c434ee82d47b46f3857540e983523b7178061b;p=lttng-tools.git Merge branch 'master' into benchmark --- diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 306988354..3395d4cf8 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -931,7 +931,7 @@ error: */ static void *thread_manage_apps(void *data) { - int i, ret, count; + int i, ret, current_nb_fd; unsigned int nb_fd = 2; int update_poll_flag = 1; struct pollfd *pollfd = NULL; @@ -942,6 +942,7 @@ static void *thread_manage_apps(void *data) DBG("[thread] Manage application started"); ust_cmd.sock = -1; + current_nb_fd = nb_fd; while (1) { /* See if we have a valid socket to add to pollfd */ @@ -952,7 +953,7 @@ static void *thread_manage_apps(void *data) /* The pollfd struct must be updated */ if (update_poll_flag) { - ret = update_apps_cmd_pollfd(nb_fd, ARRAY_SIZE(pollfd), &pollfd); + ret = update_apps_cmd_pollfd(nb_fd, current_nb_fd, &pollfd); if (ret < 0) { /* malloc failed so we quit */ goto error; @@ -1023,8 +1024,8 @@ static void *thread_manage_apps(void *data) } } - count = nb_fd; - for (i = 2; i < count; i++) { + current_nb_fd = nb_fd; + for (i = 2; i < current_nb_fd; i++) { /* Apps socket is closed/hungup */ switch (pollfd[i].revents) { case POLLERR: @@ -1039,7 +1040,7 @@ static void *thread_manage_apps(void *data) } } - if (nb_fd != count) { + if (nb_fd != current_nb_fd) { update_poll_flag = 1; } }