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))
return;
- st->signum = para_next_signal();
- if (st->signum == SIGHUP) {
+ signum = para_next_signal();
+ 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;
static void signal_post_select(struct sched *s, struct task *t)
{
struct signal_task *st = container_of(t, struct signal_task, task);
+ int signum;
if (!FD_ISSET(st->fd, &s->rfds))
return;
- st->signum = para_next_signal();
- switch (st->signum) {
+ signum = para_next_signal();
+ switch (signum) {
case SIGINT:
case SIGTERM:
case SIGHUP:
- PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+ PARA_EMERG_LOG("terminating on signal %d\n", signum);
clean_exit(EXIT_FAILURE, "caught deadly signal");
}
}
static void signal_post_select(struct sched *s, struct task *t)
{
struct signal_task *st = container_of(t, struct signal_task, task);
+ int signum;
if (!FD_ISSET(st->fd, &s->rfds))
return;
- st->signum = para_next_signal();
- switch (st->signum) {
+ signum = para_next_signal();
+ switch (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.
struct signal_task {
/** The signal pipe. */
int fd;
- /** The number of the most recent signal. */
- int signum;
/** The associated task structure. */
struct task task;
};