]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
Remove ->signum from struct signal_task.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index d738c3d99f1143648f98f0b65b714bbf1e69ccee..e2a517ece2c8451b7a2715bc7f7a943b7680d079 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -710,14 +710,16 @@ static void signal_pre_select(struct sched *s, struct task *t)
 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();
@@ -726,7 +728,7 @@ static void afs_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);
+       PARA_EMERG_LOG("terminating on signal %d\n", signum);
 shutdown:
        sched_shutdown();
        t->error = -E_AFS_SIGNAL;
@@ -930,14 +932,11 @@ static void command_post_select(struct sched *s, struct task *t)
                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));