X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=4470afc5e8dd1cf51428f9b5ce22d5ce2e5c217f;hb=07d2ae956551db46c137f85847a6d2972b1b0c9d;hp=6f9834425192c3ca4b1f9f0e184071eb87f68b87;hpb=020d7f606b4264ec26bdae8b84d6e85182539ab2;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 6f9834425..4470afc5e 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -705,9 +705,9 @@ static void *thread_manage_kernel(void *data) /* * This first step of the while is to clean this structure which could free - * non NULL pointers so zero it before the loop. + * non NULL pointers so initialize it before the loop. */ - memset(&events, 0, sizeof(events)); + lttng_poll_init(&events); if (testpoint(thread_manage_kernel)) { goto error_testpoint; @@ -3108,9 +3108,8 @@ static void *thread_manage_health(void *data) rcu_register_thread(); - /* We might hit an error path before this is set once. */ - memset(&events, 0, sizeof(events)); - events.epfd = -1; + /* We might hit an error path before this is created. */ + lttng_poll_init(&events); /* Create unix socket */ sock = lttcomm_create_unix_sock(health_unix_sock_path); @@ -3277,12 +3276,6 @@ error: PERROR("close"); } } - if (new_sock >= 0) { - ret = close(new_sock); - if (ret) { - PERROR("close"); - } - } lttng_poll_clean(&events);