]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
Improve documentation of readv_nonblock().
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index a1381e738a40cf644abeb16cf8356e7c578839a6..906616d7865d8926841dfc1c587984e01e2f80dc 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -604,6 +604,7 @@ int afs_cb_result_handler(struct osl_object *result, uint8_t band,
 {
        struct command_context *cc = private;
 
+       assert(cc);
        if (!result->size)
                return 1;
        if (cc->use_sideband)
@@ -744,7 +745,7 @@ static void afs_signal_post_select(struct sched *s, struct task *t)
        }
        PARA_EMERG_LOG("terminating on signal %d\n", signum);
 shutdown:
-       sched_shutdown(s);
+       task_notify_all(s, E_AFS_SIGNAL);
        t->error = -E_AFS_SIGNAL;
 }
 
@@ -921,10 +922,16 @@ static void command_post_select(struct sched *s, struct task *t)
        struct afs_client *client, *tmp;
        int fd, ret;
 
+       ret = task_get_notification(t);
+       if (ret < 0) {
+               t->error = ret;
+               return;
+       }
        ret = execute_server_command(&s->rfds);
        if (ret < 0) {
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));
-               sched_shutdown(s);
+               task_notify_all(s, -ret);
+               t->error = ret;
                return;
        }
        /* Check the list of connected clients. */
@@ -1063,7 +1070,7 @@ int com_init(struct command_context *cc)
        }
        ret = send_callback_request(create_tables_callback, &query,
                afs_cb_result_handler, cc);
-       if (ret < 0)
+       if (ret < 0 && !cc->use_sideband)
                /* ignore return value */
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;