diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index a97312c9bf..94720c9adf 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -146,7 +146,7 @@ int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) { } } - if (t != USEC_INFINITY && fd > 0) { + if (t != USEC_INFINITY && fd >= 0) { /* Let's wait the specified amount of time for input. When we have no fd we skip this, under * the assumption that this is an fmemopen() stream or so where waiting doesn't make sense * anyway, as the data is either already in the stream or cannot possible be placed there