static void signal_post_select(struct sched *s, struct task *t)
{
struct signal_task *st = t->private_data;
+ t->ret = -E_AFS_PARENT_DIED;
+ if (getppid() == 1)
+ goto err;
t->ret = 1;
if (!FD_ISSET(st->fd, &s->rfds))
return;
if (st->signum == SIGHUP) {
close_afs_tables();
t->ret = open_afs_tables();
+ /* FIXME: Restore current mood or playlist */
+ if (t->ret < 0)
+ goto err;
return;
}
- PARA_NOTICE_LOG("caught signal %d\n", st->signum);
t->ret = -E_AFS_SIGNAL;
+err:
+ PARA_NOTICE_LOG("%s\n", PARA_STRERROR(-t->ret));
unregister_tasks();
}
PARA_ERROR(INPUT_TOO_LARGE, "input too large for stdin command"), \
PARA_ERROR(AFS_SYNTAX, "afs syntax error"), \
PARA_ERROR(AFS_SIGNAL, "afs caught deadly signal"), \
+ PARA_ERROR(AFS_PARENT_DIED, "fatal: server process terminated"), \
#define MOOD_ERRORS \