gui: Combine open_stat_pipe() and para_open_stat_pipe().
[paraslash.git] / server.c
index 2afb6db58de95906ba9bbd19f52a79ce054ae59d..bc143039563b830b07164efd96ac76a4f6d3e267 100644 (file)
--- a/server.c
+++ b/server.c
@@ -276,15 +276,13 @@ static void handle_sighup(void)
                kill(mmd->afs_pid, SIGHUP);
 }
 
-static void signal_post_select(struct sched *s, struct task *t)
+static void signal_post_select(struct sched *s, __a_unused struct task *t)
 {
-       struct signal_task *st = container_of(t, struct signal_task, task);
+       int signum = para_next_signal(&s->rfds);
 
-       if (!FD_ISSET(st->fd, &s->rfds))
+       switch (signum) {
+       case 0:
                return;
-
-       st->signum = para_next_signal();
-       switch (st->signum) {
        case SIGHUP:
                handle_sighup();
                break;
@@ -304,7 +302,7 @@ static void signal_post_select(struct sched *s, struct task *t)
        /* die on sigint/sigterm. Kill all children too. */
        case SIGINT:
        case SIGTERM:
-               PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+               PARA_EMERG_LOG("terminating on signal %d\n", signum);
                kill(0, SIGTERM);
                /*
                 * We must wait for afs because afs catches SIGINT/SIGTERM.