afs signal task: Switch to the alternative post select method.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 17:58:26 +0000 (17:58 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:46 +0000 (14:12 +0200)
afs.c

diff --git a/afs.c b/afs.c
index eb18708..71b8b87 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -723,9 +723,9 @@ static void signal_pre_select(struct sched *s, struct task *t)
        para_fd_set(st->fd, &s->rfds, &s->max_fileno);
 }
 
-static void afs_signal_post_select(struct sched *s, struct task *t)
+static int afs_signal_post_select(struct sched *s, __a_unused struct task *t)
 {
-       int signum;
+       int signum, ret;
 
        if (getppid() == 1) {
                PARA_EMERG_LOG("para_server died\n");
@@ -733,20 +733,20 @@ static void afs_signal_post_select(struct sched *s, struct task *t)
        }
        signum = para_next_signal(&s->rfds);
        if (signum == 0)
-               return;
+               return 0;
        if (signum == SIGHUP) {
                close_afs_tables();
                parse_config_or_die(1);
-               t->error = open_afs_tables();
-               if (t->error < 0)
-                       return;
+               ret = open_afs_tables();
+               if (ret < 0)
+                       return ret;
                init_admissible_files(current_mop);
-               return;
+               return 0;
        }
        PARA_EMERG_LOG("terminating on signal %d\n", signum);
 shutdown:
        task_notify_all(s, E_AFS_SIGNAL);
-       t->error = -E_AFS_SIGNAL;
+       return -E_AFS_SIGNAL;
 }
 
 static void register_signal_task(struct sched *s)
@@ -761,7 +761,8 @@ static void register_signal_task(struct sched *s)
        para_install_sighandler(SIGHUP);
 
        st->task.pre_select = signal_pre_select;
-       st->task.post_select = afs_signal_post_select;
+       st->task.new_post_select = afs_signal_post_select;
+       st->task.post_select = NULL;
        sprintf(st->task.status, "signal task");
        register_task(s, &st->task);
 }