X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=inline;f=src%2Fcommon%2Fconsumer.c;h=dbec177b7328468b278d0205598e04c574609b53;hb=f66c074ce00abc984ec7cb57a4fa31b1d9cffd72;hp=16b9eb64f88ae006a742ade5d3d05b162d5bb0ef;hpb=cb365c03b0b4efc0d3f0875be586a8f4f270aaf6;p=lttng-tools.git diff --git a/src/common/consumer.c b/src/common/consumer.c index 16b9eb64f..dbec177b7 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -56,15 +56,12 @@ struct lttng_consumer_global_data consumer_data = { volatile int consumer_quit; /* - * The following two hash tables are visible by all threads which are separated - * in different source files. - * * Global hash table containing respectively metadata and data streams. The * stream element in this ht should only be updated by the metadata poll thread * for the metadata and the data poll thread for the data. */ -struct lttng_ht *metadata_ht; -struct lttng_ht *data_ht; +static struct lttng_ht *metadata_ht; +static struct lttng_ht *data_ht; /* * Notify a thread pipe to poll back again. This usually means that some global @@ -2054,7 +2051,10 @@ restart: * since their might be data to consume. */ lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]); - close(ctx->consumer_metadata_pipe[0]); + ret = close(ctx->consumer_metadata_pipe[0]); + if (ret < 0) { + PERROR("close metadata pipe"); + } continue; } else if (revents & LPOLLIN) { do { @@ -2418,7 +2418,10 @@ end: * only tracked fd in the poll set. The thread will take care of closing * the read side. */ - close(ctx->consumer_metadata_pipe[1]); + ret = close(ctx->consumer_metadata_pipe[1]); + if (ret < 0) { + PERROR("close data pipe"); + } if (data_ht) { destroy_data_stream_ht(data_ht); @@ -2638,7 +2641,10 @@ int consumer_add_relayd_socket(int net_seq_idx, int sock_type, } /* Close the created socket fd which is useless */ - close(relayd->control_sock.fd); + ret = close(relayd->control_sock.fd); + if (ret < 0) { + PERROR("close relayd control socket"); + } /* Assign new file descriptor */ relayd->control_sock.fd = fd; @@ -2652,7 +2658,10 @@ int consumer_add_relayd_socket(int net_seq_idx, int sock_type, } /* Close the created socket fd which is useless */ - close(relayd->data_sock.fd); + ret = close(relayd->data_sock.fd); + if (ret < 0) { + PERROR("close relayd control socket"); + } /* Assign new file descriptor */ relayd->data_sock.fd = fd;