Commit 13b3e9e7 authored by Max Kellermann's avatar Max Kellermann

system/FileDescriptor: make inotify_init1() mandatory on Linux

parent 8106929d
...@@ -587,9 +587,7 @@ if test x$enable_qobuz != xno || test x$enable_soundcloud != xno || test x$enabl ...@@ -587,9 +587,7 @@ if test x$enable_qobuz != xno || test x$enable_soundcloud != xno || test x$enabl
fi fi
dnl --------------------------------- inotify --------------------------------- dnl --------------------------------- inotify ---------------------------------
AC_CHECK_FUNCS(inotify_init inotify_init1) if test x$host_is_linux = xno; then
if test x$ac_cv_func_inotify_init = xno; then
enable_inotify=no enable_inotify=no
fi fi
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <sys/signalfd.h> #include <sys/signalfd.h>
#endif #endif
#ifdef HAVE_INOTIFY_INIT #ifdef __linux__
#include <sys/inotify.h> #include <sys/inotify.h>
#endif #endif
...@@ -248,23 +248,15 @@ FileDescriptor::CreateSignalFD(const sigset_t *mask) noexcept ...@@ -248,23 +248,15 @@ FileDescriptor::CreateSignalFD(const sigset_t *mask) noexcept
#endif #endif
#ifdef HAVE_INOTIFY_INIT #ifdef __linux__
bool bool
FileDescriptor::CreateInotify() noexcept FileDescriptor::CreateInotify() noexcept
{ {
#ifdef HAVE_INOTIFY_INIT1
int new_fd = inotify_init1(IN_CLOEXEC|IN_NONBLOCK); int new_fd = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
#else
int new_fd = inotify_init();
#endif
if (new_fd < 0) if (new_fd < 0)
return false; return false;
#ifndef HAVE_INOTIFY_INIT1
SetNonBlocking();
#endif
fd = new_fd; fd = new_fd;
return true; return true;
} }
......
...@@ -189,7 +189,7 @@ public: ...@@ -189,7 +189,7 @@ public:
bool CreateSignalFD(const sigset_t *mask) noexcept; bool CreateSignalFD(const sigset_t *mask) noexcept;
#endif #endif
#ifdef HAVE_INOTIFY_INIT #ifdef __linux__
bool CreateInotify() noexcept; bool CreateInotify() noexcept;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment