/*
- * Copyright (C) 2007-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2010 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
static void afs_signal_post_select(struct sched *s, struct task *t)
{
- struct signal_task *st = container_of(t, struct signal_task, task);
+ int signum;
+
if (getppid() == 1) {
PARA_EMERG_LOG("para_server died\n");
goto shutdown;
}
- if (!FD_ISSET(st->fd, &s->rfds))
+ signum = para_next_signal(&s->rfds);
+ if (signum == 0)
return;
- st->signum = para_next_signal();
- if (st->signum == SIGHUP) {
+ if (signum == SIGHUP) {
close_afs_tables();
parse_config_or_die(1);
t->error = open_afs_tables();
init_admissible_files(current_mop);
return;
}
- PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+ PARA_EMERG_LOG("terminating on signal %d\n", signum);
shutdown:
sched_shutdown();
t->error = -E_AFS_SIGNAL;
free(client);
}
/* Accept connections on the local socket. */
- if (!FD_ISSET(ct->fd, &s->rfds))
- return;
- ret = para_accept(ct->fd, &unix_addr, sizeof(unix_addr));
- if (ret < 0) {
+ ret = para_accept(ct->fd, &s->rfds, &unix_addr, sizeof(unix_addr), &fd);
+ if (ret < 0)
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
+ if (ret <= 0)
return;
- }
- fd = ret;
ret = mark_fd_nonblocking(fd);
if (ret < 0) {
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
}
}
+/**
+ * Dummy event handler for the images table.
+ *
+ * \param event Unused.
+ * \param pb Unused.
+ * \param data Unused.
+ *
+ * This table does not honor events.
+ */
int images_event_handler(__a_unused enum afs_events event,
__a_unused struct para_buffer *pb, __a_unused void *data)
{
return 1;
}
+/**
+ * Dummy event handler for the lyrics table.
+ *
+ * \param event Unused.
+ * \param pb Unused.
+ * \param data Unused.
+ *
+ * This table does not honor events.
+ */
int lyrics_event_handler(__a_unused enum afs_events event,
__a_unused struct para_buffer *pb, __a_unused void *data)
{