projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: goto error_fatal on lttng_ustconsumer_recv_cmd errors
[lttng-tools.git]
/
src
/
common
/
ust-consumer
/
ust-consumer.c
diff --git
a/src/common/ust-consumer/ust-consumer.c
b/src/common/ust-consumer/ust-consumer.c
index f7ffb0febf5b7bcdc338b30975ae7e3379724935..cd6277f1aa42995735c95cbdf296e3cec55386cf 100644
(file)
--- a/
src/common/ust-consumer/ust-consumer.c
+++ b/
src/common/ust-consumer/ust-consumer.c
@@
-796,6
+796,9
@@
int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
* The ret value might 0 meaning an orderly shutdown but this is ok
* since the caller handles this.
*/
* The ret value might 0 meaning an orderly shutdown but this is ok
* since the caller handles this.
*/
+ if (ret > 0) {
+ ret = -1;
+ }
return ret;
}
if (msg.cmd_type == LTTNG_CONSUMER_STOP) {
return ret;
}
if (msg.cmd_type == LTTNG_CONSUMER_STOP) {
@@
-871,6
+874,7
@@
int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
sizeof(is_data_pending));
if (ret < 0) {
DBG("Error when sending the data pending ret code: %d", ret);
sizeof(is_data_pending));
if (ret < 0) {
DBG("Error when sending the data pending ret code: %d", ret);
+ goto error_fatal;
}
/*
}
/*
@@
-977,10
+981,9
@@
int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
ret = consumer_send_status_channel(sock, channel);
if (ret < 0) {
/*
ret = consumer_send_status_channel(sock, channel);
if (ret < 0) {
/*
- * There is probably a problem on the socket so the poll will get
- * it and clean everything up.
+ * There is probably a problem on the socket.
*/
*/
- goto e
nd_nosign
al;
+ goto e
rror_fat
al;
}
break;
}
break;
@@
-1002,7
+1005,7
@@
int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
ret = consumer_send_status_msg(sock, LTTNG_OK);
if (ret < 0) {
/* Somehow, the session daemon is not responding anymore. */
ret = consumer_send_status_msg(sock, LTTNG_OK);
if (ret < 0) {
/* Somehow, the session daemon is not responding anymore. */
- goto e
nd_nosign
al;
+ goto e
rror_fat
al;
}
/* Send everything to sessiond. */
}
/* Send everything to sessiond. */
@@
-1098,14
+1101,14
@@
int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
/* Wait for more data. */
if (lttng_consumer_poll_socket(consumer_sockpoll) < 0) {
/* Wait for more data. */
if (lttng_consumer_poll_socket(consumer_sockpoll) < 0) {
- goto e
nd_nosign
al;
+ goto e
rror_fat
al;
}
ret = lttng_ustconsumer_recv_metadata(sock, key, offset,
len, channel);
if (ret < 0) {
/* error receiving from sessiond */
}
ret = lttng_ustconsumer_recv_metadata(sock, key, offset,
len, channel);
if (ret < 0) {
/* error receiving from sessiond */
- goto e
nd_nosign
al;
+ goto e
rror_fat
al;
} else {
ret_code = ret;
goto end_msg_sessiond;
} else {
ret_code = ret;
goto end_msg_sessiond;
@@
-1140,7
+1143,10
@@
end_msg_sessiond:
* the caller because the session daemon socket management is done
* elsewhere. Returning a negative code or 0 will shutdown the consumer.
*/
* the caller because the session daemon socket management is done
* elsewhere. Returning a negative code or 0 will shutdown the consumer.
*/
- (void) consumer_send_status_msg(sock, ret_code);
+ ret = consumer_send_status_msg(sock, ret_code);
+ if (ret < 0) {
+ goto error_fatal;
+ }
rcu_read_unlock();
return 1;
end_channel_error:
rcu_read_unlock();
return 1;
end_channel_error:
This page took
0.028303 seconds
and
5
git commands to generate.