#include <common/payload.h>
#include <common/payload-view.h>
#include <common/unix.h>
-#include <assert.h>
#include "lttng-ctl-helper.h"
#include <common/compat/poll.h>
{
struct lttng_notification_channel_message *msg;
- assert(channel->reception_payload.buffer.size >= sizeof(*msg));
+ LTTNG_ASSERT(channel->reception_payload.buffer.size >= sizeof(*msg));
msg = (struct lttng_notification_channel_message *)
channel->reception_payload.buffer.data;
}
if (is_root || is_in_tracing_group) {
- lttng_ctl_copy_string(sock_path,
+ ret = lttng_strncpy(sock_path,
DEFAULT_GLOBAL_NOTIFICATION_CHANNEL_UNIX_SOCK,
LTTNG_PATH_MAX);
+ if (ret) {
+ ret = -LTTNG_ERR_INVALID;
+ goto error;
+ }
+
ret = lttcomm_connect_unix_sock(sock_path);
if (ret >= 0) {
fd = ret;
if (channel->pending_notifications.count) {
struct pending_notification *pending_notification;
- assert(!cds_list_empty(&channel->pending_notifications.list));
+ LTTNG_ASSERT(!cds_list_empty(&channel->pending_notifications.list));
/* Deliver one of the pending notifications. */
pending_notification = cds_list_first_entry(
goto end;
}
- assert(type == LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_SUBSCRIBE ||
+ LTTNG_ASSERT(type == LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_SUBSCRIBE ||
type == LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_UNSUBSCRIBE);
pthread_mutex_lock(&channel->lock);