From 4c9dd1e4b95e273eacc900abb63db4b8bafaf34b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 13 Feb 1999 19:43:21 +0000 Subject: Synchronize signals to the main select/event/timer loop. Parse command line options. --- sysdep/unix/io.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'sysdep/unix/io.c') diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index bb8f8af..d8713f4 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -677,6 +677,9 @@ sk_dump_all(void) * Main I/O Loop */ +volatile int async_config_flag; /* Asynchronous reconfiguration/dump scheduled */ +volatile int async_dump_flag; + void io_init(void) { @@ -735,6 +738,24 @@ io_loop(void) } } + /* + * Yes, this is racy. But even if the signal comes before this test + * and entering select(), it gets caught on the next timer tick. + */ + + if (async_config_flag) + { + async_config(); + async_config_flag = 0; + } + if (async_dump_flag) + { + async_dump(); + async_dump_flag = 0; + } + + /* And finally enter select() to find active sockets */ + hi = select(hi+1, &rd, &wr, NULL, &timo); if (hi < 0) { -- cgit v1.2.3