summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index f5f1b3a45e..f8b3f44ad1 100644
--- a/util.c
+++ b/util.c
@@ -1627,8 +1627,9 @@ int acquire_terminal(const char *name, bool fail, bool force) {
}
for (;;) {
- if ((r = flush_fd(notify)) < 0)
- goto fail;
+ if (notify >= 0)
+ if ((r = flush_fd(notify)) < 0)
+ goto fail;
/* We pass here O_NOCTTY only so that we can check the return
* value TIOCSCTTY and have a reliable way to figure out if we