Use sideband also for challenge response.
[paraslash.git] / interactive.c
index e17a7a1..f9ea361 100644 (file)
@@ -292,7 +292,7 @@ static void i9e_post_select(struct sched *s, struct task *t)
        sz = btr_next_buffer(btrn, &buf);
        if (sz == 0)
                goto out;
        sz = btr_next_buffer(btrn, &buf);
        if (sz == 0)
                goto out;
-       ret = write_nonblock(ici->fds[1], buf, sz);
+       ret = xwrite(ici->fds[1], buf, sz);
        if (ret < 0)
                goto rm_btrn;
        btr_consume(btrn, ret);
        if (ret < 0)
                goto rm_btrn;
        btr_consume(btrn, ret);
@@ -334,7 +334,6 @@ static void i9e_pre_select(struct sched *s, __a_unused struct task *t)
                PARA_WARNING_LOG("set to nonblock failed: (fd0 %d, %s)\n",
                        i9ep->ici->fds[0], para_strerror(-ret));
        para_fd_set(i9ep->ici->fds[0], &s->rfds, &s->max_fileno);
                PARA_WARNING_LOG("set to nonblock failed: (fd0 %d, %s)\n",
                        i9ep->ici->fds[0], para_strerror(-ret));
        para_fd_set(i9ep->ici->fds[0], &s->rfds, &s->max_fileno);
-       return;
 }
 
 static void update_winsize(void)
 }
 
 static void update_winsize(void)
@@ -376,12 +375,14 @@ int i9e_open(struct i9e_client_info *ici, struct sched *s)
                return ret;
        i9ep->task.pre_select = i9e_pre_select;
        i9ep->task.post_select = i9e_post_select;
                return ret;
        i9ep->task.pre_select = i9e_pre_select;
        i9ep->task.post_select = i9e_post_select;
+       sprintf(i9ep->task.status, "i9e");
        register_task(s, &i9ep->task);
        rl_readline_name = "para_i9e";
        rl_basic_word_break_characters = " ";
        rl_attempted_completion_function = i9e_completer;
        i9ep->ici = ici;
        i9ep->stderr_stream = fdopen(ici->fds[2], "w");
        register_task(s, &i9ep->task);
        rl_readline_name = "para_i9e";
        rl_basic_word_break_characters = " ";
        rl_attempted_completion_function = i9e_completer;
        i9ep->ici = ici;
        i9ep->stderr_stream = fdopen(ici->fds[2], "w");
+       setvbuf(i9ep->stderr_stream, NULL, _IONBF, 0);
 
        if (ici->history_file)
                read_history(ici->history_file);
 
        if (ici->history_file)
                read_history(ici->history_file);