projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix pollfd update bug in thread_manage apps
[lttng-tools.git]
/
ltt-sessiond
/
main.c
diff --git
a/ltt-sessiond/main.c
b/ltt-sessiond/main.c
index 85ac06be9e32c2967417513b7902d2b226b303ba..c9522d697f5cc698217b94dc495312af7ee9c7d2 100644
(file)
--- a/
ltt-sessiond/main.c
+++ b/
ltt-sessiond/main.c
@@
-899,7
+899,7
@@
error:
*/
static void *thread_manage_apps(void *data)
{
*/
static void *thread_manage_apps(void *data)
{
- int i, ret, c
ount
;
+ int i, ret, c
urrent_nb_fd
;
unsigned int nb_fd = 2;
int update_poll_flag = 1;
struct pollfd *pollfd = NULL;
unsigned int nb_fd = 2;
int update_poll_flag = 1;
struct pollfd *pollfd = NULL;
@@
-908,6
+908,7
@@
static void *thread_manage_apps(void *data)
DBG("[thread] Manage application started");
ust_cmd.sock = -1;
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 */
while (1) {
/* See if we have a valid socket to add to pollfd */
@@
-918,7
+919,7
@@
static void *thread_manage_apps(void *data)
/* The pollfd struct must be updated */
if (update_poll_flag) {
/* 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;
if (ret < 0) {
/* malloc failed so we quit */
goto error;
@@
-978,8
+979,8
@@
static void *thread_manage_apps(void *data)
}
}
}
}
- c
ount
= nb_fd;
- for (i = 2; i < c
ount
; i++) {
+ c
urrent_nb_fd
= nb_fd;
+ for (i = 2; i < c
urrent_nb_fd
; i++) {
/* Apps socket is closed/hungup */
switch (pollfd[i].revents) {
case POLLERR:
/* Apps socket is closed/hungup */
switch (pollfd[i].revents) {
case POLLERR:
@@
-994,7
+995,7
@@
static void *thread_manage_apps(void *data)
}
}
}
}
- if (nb_fd != c
ount
) {
+ if (nb_fd != c
urrent_nb_fd
) {
update_poll_flag = 1;
}
}
update_poll_flag = 1;
}
}
This page took
0.023665 seconds
and
4
git commands to generate.