]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus: Correct check for inotify_init() failure
authorSimon McVittie <smcv@collabora.com>
Fri, 10 Dec 2021 13:08:38 +0000 (13:08 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 28 Feb 2022 22:50:26 +0000 (22:50 +0000)
fd 0 is a valid fd - although if we are using stdin as our inotify fd,
something is weird somewhere.

Signed-off-by: Simon McVittie <smcv@collabora.com>
bus/dir-watch-inotify.c

index 940f09a08e01cae832df883501e4178b9957ea51..6cc02968f123faab6b826c9bcb55f0252d08ee7c 100644 (file)
@@ -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;