chiark / gitweb /
systemctl: try to reload daemon after enable/disable only when not running in a chroot
[elogind.git] / src / readahead / readahead-collect.c
index 4fcf64c24d766833b70f01c1d7104d45079979c6..5d07f4704af0837a588d0cc1c5293e4ac72b4e3f 100644 (file)
 #include <getopt.h>
 #include <sys/inotify.h>
 
+#ifdef HAVE_FANOTIFY_INIT
+#include <sys/fanotify.h>
+#endif
+
 #include <systemd/sd-daemon.h>
 
 #include "missing.h"
@@ -456,7 +460,7 @@ static int collect(const char *root) {
                                 log_warning("readlink(%s) failed: %s", fn, strerror(-k));
 
                 next_iteration:
-                        if (m->fd)
+                        if (m->fd >= 0)
                                 close_nointr_nofail(m->fd);
                 }
         }