X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_unix_socket.c;h=b32a5174aa772e844e4a660d48a8626defcf7bf6;hp=ca49e1b328ea61e07db86151225fe65085423fbc;hb=7b0027b3e2a8b3120980f43a58f132ee58b69f54;hpb=0b5a4de9aa05787410e50ce238ceb199a642154d diff --git a/tests/unit/test_unix_socket.c b/tests/unit/test_unix_socket.c index ca49e1b32..b32a5174a 100644 --- a/tests/unit/test_unix_socket.c +++ b/tests/unit/test_unix_socket.c @@ -5,6 +5,7 @@ * */ +#include #include #include #include @@ -12,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -65,17 +65,17 @@ static void test_high_fd_count(unsigned int fd_count) for (i = 0; i < fd_count; i++) { struct fd_handle *handle; - const int fd = eventfd(0, 0); + int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); if (fd < 0) { - PERROR("Failed to create event fd while creating test payload"); + PERROR("Failed to create fd while creating test payload"); goto error; } handle = fd_handle_create(fd); if (!handle) { if (close(fd)) { - PERROR("Failed to close event fd while preparing test payload"); + PERROR("Failed to close fd while preparing test payload"); goto error; } } @@ -221,16 +221,16 @@ static void test_one_fd_per_message(unsigned int message_count) goto error; } - fd = eventfd(0, 0); + fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); if (fd < 0) { - PERROR("Failed to create event fd while creating test payload"); + PERROR("Failed to create fd while creating test payload"); goto error; } handle = fd_handle_create(fd); if (!handle) { if (close(fd)) { - PERROR("Failed to close event fd while preparing test payload"); + PERROR("Failed to close fd while preparing test payload"); goto error; } } @@ -380,16 +380,16 @@ static void test_receive_in_chunks( goto error; } - fd = eventfd(0, 0); + fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); if (fd < 0) { - PERROR("Failed to create event fd while creating test payload"); + PERROR("Failed to create fd while creating test payload"); goto error; } handle = fd_handle_create(fd); if (!handle) { if (close(fd)) { - PERROR("Failed to close event fd while preparing test payload"); + PERROR("Failed to close fd while preparing test payload"); goto error; } }