From 18aeca0536f05906bf4364bc831fd7c769f60608 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 12 Dec 2018 15:11:15 -0500 Subject: [PATCH] Fix: handle_notification_thread_command: handle partial read MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/notification-thread-events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 3482a7e89..9cc91cc40 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -2277,9 +2277,9 @@ int handle_notification_thread_command( 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; } -- 2.34.1