util: flush inotify fd only when we have it

This commit is contained in:
Lennart Poettering 2010-05-14 04:36:47 +02:00
parent affda78706
commit e3d1855bb9

5
util.c
View file

@ -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