end:
return ret;
error:
- lttng_dynamic_buffer_set_size(&channel->reception_buffer, 0);
+ if (lttng_dynamic_buffer_set_size(&channel->reception_buffer, 0)) {
+ ret = -1;
+ }
goto end;
}
goto end;
}
+ pthread_mutex_lock(&channel->lock);
+
if (channel->pending_notifications.count) {
struct pending_notification *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;
end_unlock:
pthread_mutex_unlock(&channel->lock);
+ *_notification = notification;
end:
- if (_notification) {
- *_notification = notification;
- }
return status;
}
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;