diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-14 04:36:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-14 04:36:47 +0200 |
commit | e3d1855bb991f7b118b77e6a2520eb4049cf5438 (patch) | |
tree | fc3ec8168438081325c8ca846deab2f578f39985 | |
parent | affda78706e2388902dd7c9ebdece52787afe3b4 (diff) |
util: flush inotify fd only when we have it
-rw-r--r-- | util.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |