]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
Make para_server use the generic scheduling code.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index e2e252152cf7c300c9842ae153a5fcbaa1b45271..d9461bb7617aaca1c56b7709c6326e0924966562 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -757,8 +757,8 @@ static void signal_post_select(struct sched *s, struct task *t)
 {
        struct signal_task *st = container_of(t, struct signal_task, task);
        if (getppid() == 1) {
-               t->error = -E_AFS_PARENT_DIED;
-               return;
+               PARA_EMERG_LOG("para_server died\n");
+               goto shutdown;
        }
        if (!FD_ISSET(st->fd, &s->rfds))
                return;
@@ -771,6 +771,8 @@ static void signal_post_select(struct sched *s, struct task *t)
                init_admissible_files(current_mop);
                return;
        }
+       PARA_EMERG_LOG("terminating on signal %d\n", st->signum);
+shutdown:
        sched_shutdown();
        t->error = -E_AFS_SIGNAL;
 }
@@ -1020,7 +1022,7 @@ static void register_command_task(uint32_t cookie)
  */
 __noreturn void afs_init(uint32_t cookie, int socket_fd)
 {
-       struct sched s;
+       static struct sched s;
        int i, ret;
 
        register_signal_task();