summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index a3d60863..b98d7948 100644
--- a/stream.c
+++ b/stream.c
@@ -1236,8 +1236,13 @@ val normalize_mode(struct stdio_mode *m, val mode_str)
val set_mode_props(const struct stdio_mode m, val stream)
{
- if (m.interactive)
+ if (m.interactive) {
+ struct stdio_handle *h = coerce(struct stdio_handle *,
+ cobj_handle(stream, stdio_stream_s));
+ if (h->f && m.write)
+ setvbuf(h->f, (char *) NULL, _IOLBF, 0);
stream_set_prop(stream, real_time_k, t);
+ }
return stream;
}