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
fi
dnl --------------------------------- inotify ---------------------------------
AC_CHECK_FUNCS(inotify_init inotify_init1)
if test x$ac_cv_func_inotify_init = xno; then
if test x$host_is_linux = xno; then
enable_inotify=no
fi
......
......@@ -45,7 +45,7 @@
#include <sys/signalfd.h>
#endif
#ifdef HAVE_INOTIFY_INIT
#ifdef __linux__
#include <sys/inotify.h>
#endif
......@@ -248,23 +248,15 @@ FileDescriptor::CreateSignalFD(const sigset_t *mask) noexcept
#endif
#ifdef HAVE_INOTIFY_INIT
#ifdef __linux__
bool
FileDescriptor::CreateInotify() noexcept
{
#ifdef HAVE_INOTIFY_INIT1
int new_fd = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
#else
int new_fd = inotify_init();
#endif
if (new_fd < 0)
return false;
#ifndef HAVE_INOTIFY_INIT1
SetNonBlocking();
#endif
fd = new_fd;
return true;
}
......
......@@ -189,7 +189,7 @@ public:
bool CreateSignalFD(const sigset_t *mask) noexcept;
#endif
#ifdef HAVE_INOTIFY_INIT
#ifdef __linux__
bool CreateInotify() noexcept;
#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