X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=afs.c;h=2f521291096eeb3703c9f091ebb739060e68bb6e;hb=9d75ded33ce6664156acb07e311f51d55970bbea;hp=71b8b87e7dde2649ad6e0ad23f6a8bdf25a58e07;hpb=12f683937d03eb69034a3752fb0fddb749e506c5;p=paraslash.git diff --git a/afs.c b/afs.c index 71b8b87e..2f521291 100644 --- a/afs.c +++ b/afs.c @@ -761,8 +761,7 @@ static void register_signal_task(struct sched *s) para_install_sighandler(SIGHUP); st->task.pre_select = signal_pre_select; - st->task.new_post_select = afs_signal_post_select; - st->task.post_select = NULL; + st->task.post_select = afs_signal_post_select; sprintf(st->task.status, "signal task"); register_task(s, &st->task); } @@ -916,7 +915,7 @@ err: /** Shutdown connection if query has not arrived until this many seconds. */ #define AFS_CLIENT_TIMEOUT 3 -static void command_post_select(struct sched *s, struct task *t) +static int command_post_select(struct sched *s, struct task *t) { struct command_task *ct = container_of(t, struct command_task, task); struct sockaddr_un unix_addr; @@ -924,16 +923,13 @@ static void command_post_select(struct sched *s, struct task *t) int fd, ret; ret = task_get_notification(t); - if (ret < 0) { - t->error = ret; - return; - } + if (ret < 0) + return ret; ret = execute_server_command(&s->rfds); if (ret < 0) { PARA_EMERG_LOG("%s\n", para_strerror(-ret)); task_notify_all(s, -ret); - t->error = ret; - return; + return ret; } /* Check the list of connected clients. */ list_for_each_entry_safe(client, tmp, &afs_client_list, node) { @@ -954,17 +950,18 @@ static void command_post_select(struct sched *s, struct task *t) if (ret < 0) PARA_NOTICE_LOG("%s\n", para_strerror(-ret)); if (ret <= 0) - return; + return 0; ret = mark_fd_nonblocking(fd); if (ret < 0) { PARA_NOTICE_LOG("%s\n", para_strerror(-ret)); close(fd); - return; + return 0; } client = para_malloc(sizeof(*client)); client->fd = fd; client->connect_time = *now; para_list_add(&client->node, &afs_client_list); + return 0; } static void register_command_task(uint32_t cookie, struct sched *s)