diff options
author | Martin Mares <mj@ucw.cz> | 1999-02-13 19:43:21 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-02-13 19:43:21 +0000 |
commit | 4c9dd1e4b95e273eacc900abb63db4b8bafaf34b (patch) | |
tree | 36b8376959e89cecaeefdb7deff04b50cad6cb7f /sysdep/unix/io.c | |
parent | 1a54b1c6ac5177a1ef21f799f6cf28f355c5bbe9 (diff) |
Synchronize signals to the main select/event/timer loop.
Parse command line options.
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r-- | sysdep/unix/io.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index bb8f8afa..d8713f4c 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) { |