Use lttng_write() to handle partial writes (writing less than the
requested amount of bytes) as well as ret = -1, errno = EINTR.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cds_list_add_tail(&cmd->cmd_list_node,
&handle->cmd_queue.list);
/* Wake-up thread. */
- ret = write(lttng_pipe_get_writefd(handle->cmd_queue.event_pipe),
+ ret = lttng_write(lttng_pipe_get_writefd(handle->cmd_queue.event_pipe),
¬ification_counter, sizeof(notification_counter));
- if (ret < 0) {
+ if (ret != sizeof(notification_counter)) {
PERROR("write to notification thread's queue event fd");
/*
* Remove the command from the list so the notification