Fix: FDs are added to payload despite not being received
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 27 Apr 2021 01:08:18 +0000 (21:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Apr 2021 21:12:08 +0000 (17:12 -0400)
`lttcomm_recv_fds_unix_sock_non_block` can return zero on EAGAIN.

It is important not to add the raw_fds array to the payload in such case
since concretely no FDs have been received.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I551457856c885098bf0de2388936e97456051f93

src/common/unix.c

index 623421cadb98642889c56b2a6cbd1f46e7a51ca4..ae2b822af5a57debc7e0288011ab18a36abdd940 100644 (file)
@@ -780,7 +780,7 @@ ssize_t _lttcomm_recv_payload_fds_unix_sock(int sock, size_t nb_fd,
                                sock, (int *) raw_fds.buffer.data, nb_fd);
        }
 
-       if (ret < 0) {
+       if (ret <= 0) {
                goto end;
        }
 
This page took 0.026715 seconds and 5 git commands to generate.