Fix: lttng-ust-comm.c: return number of fd rather size of array
[lttng-ust.git] / liblttng-ust-comm / lttng-ust-comm.c
index 36095a1c48027f09e7ef5fddb869a08ebe005418..beeee60b9b7a02b3c63e182d9932db90538c6a05 100644 (file)
@@ -438,8 +438,6 @@ ssize_t ustcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
 /*
  * Recv a message accompanied by fd(s) from a unix socket.
  *
- * Returns the size of received data, or negative error value.
- *
  * Expect at most "nb_fd" file descriptors. Returns the number of fd
  * actually received in nb_fd.
  * Returns -EPIPE on orderly shutdown.
@@ -509,7 +507,7 @@ ssize_t ustcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd)
                goto end;
        }
        memcpy(fds, CMSG_DATA(cmsg), sizeof_fds);
-       ret = sizeof_fds;
+       ret = nb_fd;
 end:
        return ret;
 }
This page took 0.022652 seconds and 4 git commands to generate.