summaryrefslogtreecommitdiff
path: root/sysdep/unix/io.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-09-20 17:01:50 +0200
committerMaria Matejka <mq@ucw.cz>2022-09-20 17:17:50 +0200
commit6768e0cf9e4b7befbc29f2d40a6b15e1198908f5 (patch)
treef6feb422d6c4e9a16b0a2210d4ff7c51b8ab496a /sysdep/unix/io.c
parent4b4fe1bd65f0dcebe3ff51a395acf0fd21c46a5d (diff)
Pipe kick-and-drain packed into a neat structure and functions.
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r--sysdep/unix/io.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 23baffb2..6454f15f 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -2213,8 +2213,6 @@ static int short_loops = 0;
#define SHORT_LOOP_MAX 10
#define WORK_EVENTS_MAX 10
-void pipe_drain(int fd);
-
void
io_loop(void)
{
@@ -2246,8 +2244,7 @@ io_loop(void)
}
/* A hack to reload main io_loop() when something has changed asynchronously. */
- pfd[0].fd = main_birdloop.wakeup_fds[0];
- pfd[0].events = POLLIN;
+ pipe_pollin(&main_birdloop.wakeup, &pfd[0]);
nfds = 1;
@@ -2325,7 +2322,7 @@ io_loop(void)
if (pfd[0].revents & POLLIN)
{
/* IO loop reload requested */
- pipe_drain(main_birdloop.wakeup_fds[0]);
+ pipe_drain(&main_birdloop.wakeup);
atomic_exchange_explicit(&main_birdloop.ping_sent, 0, memory_order_acq_rel);
continue;
}