Use lttng_read() to handle partial reads (returning 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>
struct notification_thread_command *cmd;
/* Read the event pipe to put it back into a quiescent state. */
- ret = read(lttng_pipe_get_readfd(handle->cmd_queue.event_pipe), &counter,
+ ret = lttng_read(lttng_pipe_get_readfd(handle->cmd_queue.event_pipe), &counter,
sizeof(counter));
- if (ret == -1) {
+ if (ret != sizeof(counter)) {
goto error;
}