From 0cf7c44bc066a10f5514f2791ce3a33e1ba5668d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kokem=C3=BCller?= Date: Sat, 8 Jun 2024 11:49:00 +0200 Subject: [PATCH] autoformat --- src/epollfd_ctx.c | 18 ++++++++++-------- test/epoll-test.c | 10 +++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/epollfd_ctx.c b/src/epollfd_ctx.c index 560a76a..4be130d 100644 --- a/src/epollfd_ctx.c +++ b/src/epollfd_ctx.c @@ -310,9 +310,9 @@ registered_fds_node_feed_event(RegisteredFDsNode *fd2_node, int kq, assert(!(fd2_node->revents & ~(uint32_t)(POLLIN | POLLOUT | POLLERR | POLLHUP #ifdef POLLRDHUP - | POLLRDHUP + | POLLRDHUP #endif - ))); + ))); goto maybe_translate_rdhup; } @@ -577,7 +577,8 @@ registered_fds_node_feed_event(RegisteredFDsNode *fd2_node, int kq, } maybe_translate_rdhup: - if ((fd2_node->revents & EPOLLRDHUP) != 0 && fd2_node->needs_rdhup_translation) { + if ((fd2_node->revents & EPOLLRDHUP) != 0 && + fd2_node->needs_rdhup_translation) { fd2_node->revents &= ~EPOLLRDHUP; fd2_node->revents |= 0x2000; } @@ -1253,11 +1254,12 @@ epollfd_ctx_ctl(EpollFDCtx *epollfd, int kq, int op, int fd2, if (op != EPOLL_CTL_DEL && ((ev->events & - ~(uint32_t)(EPOLLIN | EPOLLOUT | EPOLLRDHUP | 0x2000 | /**/ - EPOLLPRI | /* unsupported by FreeBSD's kqueue! */ - EPOLLHUP | EPOLLERR | /**/ - EPOLLET | EPOLLONESHOT)) != 0 || - (EPOLLRDHUP != 0x2000 && (ev->events & EPOLLRDHUP) != 0 && (ev->events & 0x2000) != 0))) { + ~(uint32_t)(EPOLLIN | EPOLLOUT | EPOLLRDHUP | 0x2000 | /**/ + EPOLLPRI | /* unsupported by FreeBSD's kqueue! */ + EPOLLHUP | EPOLLERR | /**/ + EPOLLET | EPOLLONESHOT)) != 0 || + (EPOLLRDHUP != 0x2000 && (ev->events & EPOLLRDHUP) != 0 && + (ev->events & 0x2000) != 0))) { return EINVAL; } diff --git a/test/epoll-test.c b/test/epoll-test.c index 712bb2d..e9d84a2 100644 --- a/test/epoll-test.c +++ b/test/epoll-test.c @@ -349,7 +349,8 @@ ATF_TC_BODY_FD_LEAKCHECK(epoll__rdhup_linux, tcptr) struct epoll_event event = { .events = EPOLLIN | EPOLLRDHUP | 0x2000 | EPOLLPRI | EPOLLET, }; - ATF_REQUIRE_ERRNO(EINVAL, epoll_ctl(ep, EPOLL_CTL_ADD, fds[0], &event) < 0); + ATF_REQUIRE_ERRNO(EINVAL, + epoll_ctl(ep, EPOLL_CTL_ADD, fds[0], &event) < 0); ATF_REQUIRE(close(ep) == 0); ATF_REQUIRE(close(fds[0]) == 0); @@ -2015,12 +2016,11 @@ ATF_TC_BODY_FD_LEAKCHECK(epoll__epoll_pwait, tcptr) int n = ppoll( #endif &pfd, 1, - &(struct timespec) { - 0, + &(struct timespec) { 0, #if defined(__DragonFly__) - 1 + 1 #else - 0 + 0 #endif }, &emptyset);