X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_payload.c;h=e232cde66cfaba6f07f5d0cab56e55181e6228ad;hp=be97d49904481f6ae01819dec5ffe98993b8d760;hb=7b0027b3e2a8b3120980f43a58f132ee58b69f54;hpb=5747e45ab31cb9ad87fe17c7d4de0faf3324812b diff --git a/tests/unit/test_payload.c b/tests/unit/test_payload.c index be97d4990..e232cde66 100644 --- a/tests/unit/test_payload.c +++ b/tests/unit/test_payload.c @@ -5,10 +5,12 @@ * */ +#include + +#include #include #include #include -#include static const int TEST_COUNT = 5; @@ -27,7 +29,7 @@ static void test_fd_push_pop_order(void) diag("Validating fd push/pop order"); for (i = 0; i < 3; i++) { - int fd = eventfd(0, 0); + int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); struct fd_handle *handle; assert(fd >= 0); @@ -76,7 +78,7 @@ static void test_fd_push_pop_imbalance(void) diag("Validating fd pop imbalance"); for (i = 0; i < 10; i++) { struct fd_handle *handle; - int fd = eventfd(0, 0); + int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); assert(fd >= 0); @@ -119,14 +121,17 @@ fail: static void test_fd_pop_fd_root_views(void) { int ret, i; - const int fd = eventfd(0, 0); - struct fd_handle *handle = fd_handle_create(fd); + int fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); + struct fd_handle *handle; struct lttng_payload payload; const char * const test_description = "Same file descriptor returned when popping from different top-level views"; - lttng_payload_init(&payload); + assert(fd >= 0); + handle = fd_handle_create(fd); assert(handle); + lttng_payload_init(&payload); + diag("Validating root view fd pop behaviour"); ret = lttng_payload_push_fd_handle(&payload, handle); if (ret) {