Commit 4b044bd8 authored by Max Kellermann's avatar Max Kellermann

InotifyUpdate: pass EventLoop to mpd_inotify_init()

parent aeaf64b4
...@@ -504,7 +504,8 @@ int mpd_main(int argc, char *argv[]) ...@@ -504,7 +504,8 @@ int mpd_main(int argc, char *argv[])
if (config_get_bool(CONF_AUTO_UPDATE, false)) { if (config_get_bool(CONF_AUTO_UPDATE, false)) {
#ifdef ENABLE_INOTIFY #ifdef ENABLE_INOTIFY
if (mapper_has_music_directory()) if (mapper_has_music_directory())
mpd_inotify_init(config_get_unsigned(CONF_AUTO_UPDATE_DEPTH, mpd_inotify_init(*main_loop,
config_get_unsigned(CONF_AUTO_UPDATE_DEPTH,
G_MAXUINT)); G_MAXUINT));
#else #else
FormatWarning(main_domain, FormatWarning(main_domain,
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "InotifyQueue.hxx" #include "InotifyQueue.hxx"
#include "InotifyDomain.hxx" #include "InotifyDomain.hxx"
#include "Mapper.hxx" #include "Mapper.hxx"
#include "Main.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx" #include "fs/FileSystem.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
...@@ -286,7 +285,7 @@ mpd_inotify_callback(int wd, unsigned mask, ...@@ -286,7 +285,7 @@ mpd_inotify_callback(int wd, unsigned mask,
} }
void void
mpd_inotify_init(unsigned max_depth) mpd_inotify_init(EventLoop &loop, unsigned max_depth)
{ {
LogDebug(inotify_domain, "initializing inotify"); LogDebug(inotify_domain, "initializing inotify");
...@@ -297,7 +296,7 @@ mpd_inotify_init(unsigned max_depth) ...@@ -297,7 +296,7 @@ mpd_inotify_init(unsigned max_depth)
} }
Error error; Error error;
inotify_source = InotifySource::Create(*main_loop, inotify_source = InotifySource::Create(loop,
mpd_inotify_callback, nullptr, mpd_inotify_callback, nullptr,
error); error);
if (inotify_source == nullptr) { if (inotify_source == nullptr) {
...@@ -321,7 +320,7 @@ mpd_inotify_init(unsigned max_depth) ...@@ -321,7 +320,7 @@ mpd_inotify_init(unsigned max_depth)
recursive_watch_subdirectories(inotify_root, path, 0); recursive_watch_subdirectories(inotify_root, path, 0);
inotify_queue = new InotifyQueue(*main_loop); inotify_queue = new InotifyQueue(loop);
LogDebug(inotify_domain, "watching music directory"); LogDebug(inotify_domain, "watching music directory");
} }
......
...@@ -21,11 +21,14 @@ ...@@ -21,11 +21,14 @@
#define MPD_INOTIFY_UPDATE_HXX #define MPD_INOTIFY_UPDATE_HXX
#include "check.h" #include "check.h"
#include "Compiler.h"
class EventLoop;
#ifdef HAVE_INOTIFY_INIT #ifdef HAVE_INOTIFY_INIT
void void
mpd_inotify_init(unsigned max_depth); mpd_inotify_init(EventLoop &loop, unsigned max_depth);
void void
mpd_inotify_finish(void); mpd_inotify_finish(void);
...@@ -33,7 +36,7 @@ mpd_inotify_finish(void); ...@@ -33,7 +36,7 @@ mpd_inotify_finish(void);
#else /* !HAVE_INOTIFY_INIT */ #else /* !HAVE_INOTIFY_INIT */
static inline void static inline void
mpd_inotify_init(gcc_unused unsigned max_depth) mpd_inotify_init(gcc_unused EventLoop &loop, gcc_unused unsigned max_depth)
{ {
} }
......
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