X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=0e256053e81f531a2cb178fd57f45ff935b437e6;hp=2afb6db58de95906ba9bbd19f52a79ce054ae59d;hb=6b44f1fdf5fdfd18b9f77a87428a971eef0c547e;hpb=8dab386f87d2998fd26126600ca7faf56d5a35d1 diff --git a/server.c b/server.c index 2afb6db5..0e256053 100644 --- a/server.c +++ b/server.c @@ -77,11 +77,11 @@ #include "string.h" #include "afs.h" #include "server.h" +#include "list.h" +#include "send.h" #include "vss.h" #include "config.h" #include "close_on_fork.h" -#include "list.h" -#include "send.h" #include "net.h" #include "daemon.h" #include "ipc.h" @@ -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.