/*
- * Copyright (C) 1997-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2010 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
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;
/* 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.
pid_t child_pid;
uint32_t *chunk_table;
- if (!FD_ISSET(sct->listen_fd, &s->rfds))
- return;
- ret = para_accept(sct->listen_fd, NULL, 0);
- if (ret < 0)
+ ret = para_accept(sct->listen_fd, &s->rfds, NULL, 0, &new_fd);
+ if (ret <= 0)
goto out;
- new_fd = ret;
peer_name = remote_name(new_fd);
PARA_INFO_LOG("got connection from %s, forking\n", peer_name);
mmd->num_connects++;