diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-16 15:27:20 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-16 15:27:20 +0200 |
commit | b9307ec82d59fd266b39bd7ec4302cee0ffea137 (patch) | |
tree | d561fd3b8a13040f6edabd03499e3a74e0e21270 /src/server.c | |
parent | Fix warnings (diff) | |
download | coopgammad-b9307ec82d59fd266b39bd7ec4302cee0ffea137.tar.gz coopgammad-b9307ec82d59fd266b39bd7ec4302cee0ffea137.tar.bz2 coopgammad-b9307ec82d59fd266b39bd7ec4302cee0ffea137.tar.xz |
The stuff around supportinf SIGRTMIN+0 and SIGRTMIN+1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/server.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server.c b/src/server.c index 890c5a4..9544bad 100644 --- a/src/server.c +++ b/src/server.c @@ -94,6 +94,14 @@ extern volatile sig_atomic_t reexec; extern volatile sig_atomic_t terminate; /** + * Has the process receive a to + * disconnect from or reconnect to + * the site? 1 if disconnct, 2 if + * reconnect, 0 otherwise. + */ +extern volatile sig_atomic_t connection; + +/** * Array of all outputs */ extern struct output* outputs; @@ -1003,6 +1011,17 @@ int main_loop(void) while (!reexec && !terminate) { + if (connection == 1) /* disconnect */ + { + connection = 0; + /* TODO */ + } + else if (connection >= 2) /* reconnect */ + { + connection = 0; + /* TODO */ + } + memcpy(&fds_rd, &fds_orig, sizeof(fd_set)); memcpy(&fds_ex, &fds_orig, sizeof(fd_set)); |