diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-20 17:12:50 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-20 17:12:50 +0200 |
commit | 13b3e9e7b30cd0a84967016515c0040288e3566f (patch) | |
tree | 714a6d39e9a80e3b6722ef571d0a502c0d1403b2 /src/system | |
parent | 8106929d60d513332fa7e7c9051a377f90bd3460 (diff) |
system/FileDescriptor: make inotify_init1() mandatory on Linux
Diffstat (limited to 'src/system')
-rw-r--r-- | src/system/FileDescriptor.cxx | 12 | ||||
-rw-r--r-- | src/system/FileDescriptor.hxx | 2 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/system/FileDescriptor.cxx b/src/system/FileDescriptor.cxx index db0814469..56b3c0104 100644 --- a/src/system/FileDescriptor.cxx +++ b/src/system/FileDescriptor.cxx @@ -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; } diff --git a/src/system/FileDescriptor.hxx b/src/system/FileDescriptor.hxx index 849cde5ec..9c608f6d9 100644 --- a/src/system/FileDescriptor.hxx +++ b/src/system/FileDescriptor.hxx @@ -189,7 +189,7 @@ public: bool CreateSignalFD(const sigset_t *mask) noexcept; #endif -#ifdef HAVE_INOTIFY_INIT +#ifdef __linux__ bool CreateInotify() noexcept; #endif |