X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Fmain.c;h=46c98a5611b9e818c0c99e7e7a64bcd56a02b60e;hp=7532e2c3bdde96e18c6d82772bf2b9ae3fbb146c;hb=133842876fe8a87ba184c9ac2b6e004eb388fb73;hpb=7a3d132871a4414b6cd232e7f41e6a1f50d9bf16 diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 7532e2c3b..46c98a561 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -701,6 +701,12 @@ static void *thread_manage_kernel(void *data) while (1) { if (update_poll_flag == 1) { + /* + * Reset number of fd in the poll set. Always 2 since there is the thread + * quit pipe and the kernel pipe. + */ + events.nb_fd = 2; + ret = update_kernel_poll(&events); if (ret < 0) { goto error; @@ -1432,12 +1438,13 @@ static int mount_debugfs(char *path) ret = mkdir_recursive(path, S_IRWXU | S_IRWXG, geteuid(), getegid()); if (ret < 0) { + PERROR("Cannot create debugfs path"); goto error; } ret = mount(type, path, type, 0, NULL); if (ret < 0) { - perror("mount debugfs"); + PERROR("Cannot mount debugfs"); goto error; } @@ -1487,6 +1494,7 @@ static void init_kernel_tracer(void) } ret = mount_debugfs(debugfs_path); if (ret < 0) { + perror("Cannot mount debugfs"); goto error; } } @@ -1565,7 +1573,7 @@ static int create_ust_session(struct ltt_session *session, struct lttng_domain *domain) { int ret; - struct ltt_ust_session *lus; + struct ltt_ust_session *lus = NULL; struct ust_app *app; switch (domain->type) { @@ -1577,6 +1585,7 @@ static int create_ust_session(struct ltt_session *session, } break; default: + ret = LTTCOMM_UNKNOWN_DOMAIN; goto error; } @@ -2304,7 +2313,7 @@ static int cmd_destroy_session(struct ltt_session *session, char *name) perror("write kernel poll pipe"); } - ret = session_destroy(name); + ret = session_destroy(session); return ret; }