stream = caa_container_of(node,
struct relay_stream, stream_n);
if (stream->session == cmd->session) {
- close(stream->fd);
+ ret = close(stream->fd);
+ if (ret < 0) {
+ PERROR("close stream fd on delete session");
+ }
ret = lttng_ht_del(streams_ht, &iter);
assert(!ret);
call_rcu(&stream->rcu_node,
if (close_stream_check(stream)) {
int delret;
- close(stream->fd);
+ delret = close(stream->fd);
+ if (delret < 0) {
+ PERROR("close stream");
+ }
delret = lttng_ht_del(streams_ht, &iter);
assert(!delret);
call_rcu(&stream->rcu_node,
/* Check if we need to close the FD */
if (close_stream_check(stream)) {
+ int cret;
struct lttng_ht_iter iter;
- close(stream->fd);
+ cret = close(stream->fd);
+ if (cret < 0) {
+ PERROR("close stream process data");
+ }
iter.iter.node = &stream->stream_n.node;
ret = lttng_ht_del(streams_ht, &iter);
assert(!ret);
socket = consumer_allocate_socket(sock);
if (socket == NULL) {
+ ret = close(sock);
+ if (ret < 0) {
+ PERROR("close register consumer");
+ }
ret = LTTNG_ERR_FATAL;
- close(sock);
goto error;
}
if (len != 1) {
ret = -1;
}
- fclose(fp);
+ if (fclose(fp)) {
+ PERROR("close write_config");
+ }
end:
return ret;
}
}
error_close:
- fclose(fp);
+ ret = fclose(fp);
+ if (ret < 0) {
+ PERROR("close config read session name");
+ }
error:
return NULL;
found:
- fclose(fp);
+ ret = fclose(fp);
+ if (ret < 0) {
+ PERROR("close config read session name found");
+ }
return session_name;
}
* 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 {
* 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);
}
/* 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;
}
/* 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;