#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
-#include <errno.h>
#include <common/common.h>
+#include <common/compat/errno.h>
#include <common/sessiond-comm/sessiond-comm.h>
#include <common/fd-handle.h>
lttng_dynamic_array_init(&raw_fds, sizeof(int), NULL);
+ if (fd_count < 0) {
+ ret = -LTTNG_ERR_INVALID;
+ goto end;
+ }
+
/*
* Prepare a contiguous array of file descriptors to send them.
*