diff options
author | Simon McVittie <smcv@collabora.com> | 2021-12-10 13:08:38 +0000 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2021-12-10 13:18:39 +0000 |
commit | 5eb3615ca393c0de144aba0193e62330e89942a2 (patch) | |
tree | 3e9676cef56318c44e127e055496417c8697768a /bus | |
parent | 78c18f400f87384f5621d7efa82537c32fc5910e (diff) | |
download | dbus-5eb3615ca393c0de144aba0193e62330e89942a2.tar.gz |
bus: Correct check for inotify_init() failure
fd 0 is a valid fd - although if we get stdin as our inotify fd, something
is weird somewhere. For the dbus-daemon, in practice this should never
happen, because we use _dbus_ensure_standard_fds() to make sure stdin
is already open. For unit tests, it could in theory be the case that
stdin is closed.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'bus')
-rw-r--r-- | bus/dir-watch-inotify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c index 940f09a0..6cc02968 100644 --- a/bus/dir-watch-inotify.c +++ b/bus/dir-watch-inotify.c @@ -234,7 +234,7 @@ _init_inotify (BusContext *context) #else inotify_fd = inotify_init (); #endif - if (inotify_fd <= 0) + if (inotify_fd < 0) { _dbus_warn ("Cannot initialize inotify"); goto out; |