From: Jonathan Rajotte Date: Tue, 27 Apr 2021 01:08:18 +0000 (-0400) Subject: Fix: FDs are added to payload despite not being received X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=b3ba184e31e0e5cc67e7d7fb6594096a068ad1be Fix: FDs are added to payload despite not being received `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 Signed-off-by: Jérémie Galarneau Change-Id: I551457856c885098bf0de2388936e97456051f93 --- diff --git a/src/common/unix.c b/src/common/unix.c index 623421cad..ae2b822af 100644 --- a/src/common/unix.c +++ b/src/common/unix.c @@ -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; }