X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=client.c;h=2d6ef31f590bca1736d458cc61c4fbe67459641b;hp=7f0e3211241a77dad0d6dbe5774f6671e49823f8;hb=8536a1d8de423ab7d021c1f1364bb12fab8ce575;hpb=e009fa7ff09186e0ebd748661d46338b5eb8d016 diff --git a/client.c b/client.c index 7f0e3211..2d6ef31f 100644 --- a/client.c +++ b/client.c @@ -95,8 +95,7 @@ static int execute_client_command(const char *cmd, char **result) struct exec_task exec_task = { .task = { .pre_select = exec_pre_select, - .new_post_select = exec_post_select, - .post_select = NULL, + .post_select = exec_post_select, .status = "client exec task", }, .result_buf = para_strdup(""), @@ -446,11 +445,9 @@ static int client_i9e_line_handler(char *line) int ret; client_disconnect(ct); - if (!line || !*line) - return 0; - PARA_DEBUG_LOG("line handler: %s\n", line); + PARA_DEBUG_LOG("line: %s\n", line); ret = make_client_argv(line); - if (ret < 0) + if (ret <= 0) return ret; ret = client_connect(ct, &sched, NULL, NULL); if (ret < 0) @@ -478,7 +475,7 @@ __noreturn static void interactive_session(void) .completers = completers, }; - PARA_NOTICE_LOG("\n%s\n", VERSION_TEXT("client")); + PARA_NOTICE_LOG("\n%s\n", version_text("client")); if (ct->conf.history_file_given) history_file = para_strdup(ct->conf.history_file_arg); else { @@ -531,23 +528,21 @@ __noreturn static void print_completions(void) #endif /* HAVE_READLINE */ -static void supervisor_post_select(struct sched *s, struct task *t) +static int supervisor_post_select(struct sched *s, __a_unused struct task *t) { - if (ct->task.error < 0) { - t->error = ct->task.error; - return; - } + if (ct->task.error < 0) + return ct->task.error; if (ct->status == CL_SENDING) { stdin_set_defaults(&sit); register_task(s, &sit.task); - t->error = -E_TASK_STARTED; - return; + return -E_TASK_STARTED; } if (ct->status == CL_RECEIVING) { stdout_set_defaults(&sot); register_task(s, &sot.task); - t->error = -E_TASK_STARTED; return; + return -E_TASK_STARTED; } + return 0; } static struct task svt = {