X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-comm.c;h=0116b5f744160cab7d4077146d4a532f606359d8;hb=5f003977aaebf8bed9cc3627d3e1b5ff9e6893e6;hp=b90df8610edb6cee07e0bef8ac4ec82cb787b5a2;hpb=f645cfa794fc481dff6cb30ea56e93f825b3d423;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index b90df861..0116b5f7 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -325,14 +325,20 @@ end: || lum->cmd == LTTNG_UST_CHANNEL || lum->cmd == LTTNG_UST_METADATA) && lur.ret_code == USTCOMM_OK) { + int sendret = 0; + /* we also need to send the file descriptors. */ ret = ustcomm_send_fds_unix_sock(sock, &shm_fd, &shm_fd, 1, sizeof(int)); if (ret < 0) { perror("send shm_fd"); - goto error; + sendret = ret; } + /* + * The sessiond expects 2 file descriptors, even upon + * error. + */ ret = ustcomm_send_fds_unix_sock(sock, &wait_fd, &wait_fd, 1, sizeof(int)); @@ -340,6 +346,10 @@ end: perror("send wait_fd"); goto error; } + if (sendret) { + ret = sendret; + goto error; + } } /* * We still have the memory map reference, and the fds have been @@ -396,7 +406,7 @@ void cleanup_sock_info(struct sock_info *sock_info, int exiting) int ret; if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing apps socket"); } @@ -676,7 +686,7 @@ restart: } if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing %s apps socket", sock_info->name); } @@ -840,6 +850,7 @@ void __attribute__((constructor)) lttng_ust_init(void) */ lttng_fixup_event_tls(); lttng_fixup_ringbuffer_tls(); + lttng_fixup_vtid_tls(); /* * We want precise control over the order in which we construct