All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-tools] Fix: run_command_wait() handle partial write
@ 2018-12-13 18:56 Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2018-12-13 18:56 UTC (permalink / raw)
  To: jgalar, joraj; +Cc: lttng-dev

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>
---
 src/bin/lttng-sessiond/notification-thread-commands.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/lttng-sessiond/notification-thread-commands.c b/src/bin/lttng-sessiond/notification-thread-commands.c
index 11275ffc..129cf4ee 100644
--- a/src/bin/lttng-sessiond/notification-thread-commands.c
+++ b/src/bin/lttng-sessiond/notification-thread-commands.c
@@ -44,9 +44,9 @@ int run_command_wait(struct notification_thread_handle *handle,
 	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),
 			&notification_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
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH lttng-tools] Fix: run_command_wait() handle partial write
       [not found] <20181213185635.8019-1-mathieu.desnoyers@efficios.com>
@ 2019-01-22 20:33 ` Jérémie Galarneau
  0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2019-01-22 20:33 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: lttng-dev, Jeremie Galarneau, Jonathan Rajotte-Julien

Merged in master, stable-2.11, and stable-2.10.

Thanks,
Jérémie

On Thu, 13 Dec 2018 at 13:56, Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> wrote:
>
> 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>
> ---
>  src/bin/lttng-sessiond/notification-thread-commands.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/bin/lttng-sessiond/notification-thread-commands.c b/src/bin/lttng-sessiond/notification-thread-commands.c
> index 11275ffc..129cf4ee 100644
> --- a/src/bin/lttng-sessiond/notification-thread-commands.c
> +++ b/src/bin/lttng-sessiond/notification-thread-commands.c
> @@ -44,9 +44,9 @@ int run_command_wait(struct notification_thread_handle *handle,
>         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),
>                         &notification_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
> --
> 2.11.0
>


-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-22 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 18:56 [PATCH lttng-tools] Fix: run_command_wait() handle partial write Mathieu Desnoyers
     [not found] <20181213185635.8019-1-mathieu.desnoyers@efficios.com>
2019-01-22 20:33 ` Jérémie Galarneau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.