]> git.tue.mpg.de Git - paraslash.git/commitdiff
interactive: Set stderr to nonbuffered mode.
authorAndre Noll <maan@systemlinux.org>
Thu, 5 Apr 2012 23:18:23 +0000 (01:18 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 5 Apr 2012 23:21:19 +0000 (01:21 +0200)
fdopen() might return a stream which is fully buffered or line buffered.
We want unbuffered unconditionally, so explicitly set the stream to
unbuffered mode.

interactive.c

index 00b30223579821f8e3ee4071c6de9df61129e90a..12fcfe15440526b224b2f01a9f4bfe753e2edbd1 100644 (file)
@@ -381,6 +381,7 @@ int i9e_open(struct i9e_client_info *ici, struct sched *s)
        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);