projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: channel lock must be taken to check for pending notifications
[lttng-tools.git]
/
src
/
lib
/
lttng-ctl
/
channel.c
diff --git
a/src/lib/lttng-ctl/channel.c
b/src/lib/lttng-ctl/channel.c
index 5bfb75902e2ff98155884208668125ecd9db1799..f2daf0d50e360f050e3146431b1fede07833ddf3 100644
(file)
--- a/
src/lib/lttng-ctl/channel.c
+++ b/
src/lib/lttng-ctl/channel.c
@@
-215,6
+215,8
@@
lttng_notification_channel_get_next_notification(
goto end;
}
goto end;
}
+ pthread_mutex_lock(&channel->lock);
+
if (channel->pending_notifications.count) {
struct pending_notification *pending_notification;
if (channel->pending_notifications.count) {
struct pending_notification *pending_notification;
@@
-232,11
+234,9
@@
lttng_notification_channel_get_next_notification(
cds_list_del(&pending_notification->node);
channel->pending_notifications.count--;
free(pending_notification);
cds_list_del(&pending_notification->node);
channel->pending_notifications.count--;
free(pending_notification);
- goto end;
+ goto end
_unlock
;
}
}
- pthread_mutex_lock(&channel->lock);
-
ret = receive_message(channel);
if (ret) {
status = LTTNG_NOTIFICATION_CHANNEL_STATUS_ERROR;
ret = receive_message(channel);
if (ret) {
status = LTTNG_NOTIFICATION_CHANNEL_STATUS_ERROR;
@@
-444,7
+444,7
@@
int handshake(struct lttng_notification_channel *channel)
pthread_mutex_lock(&channel->lock);
pthread_mutex_lock(&channel->lock);
- ret = lttcomm_send_unix_sock(channel->socket, send_buffer,
+ ret = lttcomm_send_
creds_
unix_sock(channel->socket, send_buffer,
sizeof(send_buffer));
if (ret < 0) {
goto end_unlock;
sizeof(send_buffer));
if (ret < 0) {
goto end_unlock;
This page took
0.024577 seconds
and
5
git commands to generate.