aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_inotify.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-10 19:13:00 +0100
committerMax Kellermann <max@duempel.org>2013-01-14 09:15:49 +0100
commite83f805b8fa34db8ac0b885d3fb78c0e6437c908 (patch)
tree25c78bb3b016875aa9df2ec5449c623148083531 /test/run_inotify.cxx
parentbe98afe34d550a322adea78f92f1fd2088408e96 (diff)
downloadmpd-e83f805b8fa34db8ac0b885d3fb78c0e6437c908.tar.gz
mpd-e83f805b8fa34db8ac0b885d3fb78c0e6437c908.tar.xz
mpd-e83f805b8fa34db8ac0b885d3fb78c0e6437c908.zip
Main, IOThread: move GMainLoop setup code to class EventLoop
Diffstat (limited to 'test/run_inotify.cxx')
-rw-r--r--test/run_inotify.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx
index 2b77130d8..7052210b1 100644
--- a/test/run_inotify.cxx
+++ b/test/run_inotify.cxx
@@ -19,18 +19,19 @@
#include "config.h"
#include "InotifySource.hxx"
+#include "event/Loop.hxx"
#include <glib.h>
#include <sys/inotify.h>
#include <signal.h>
-static GMainLoop *main_loop;
+static EventLoop *event_loop;
static void
exit_signal_handler(G_GNUC_UNUSED int signum)
{
- g_main_loop_quit(main_loop);
+ event_loop->Break();
}
enum {
@@ -78,7 +79,7 @@ int main(int argc, char **argv)
return 2;
}
- main_loop = g_main_loop_new(NULL, false);
+ event_loop = new EventLoop(EventLoop::Default());
struct sigaction sa;
sa.sa_flags = 0;
@@ -87,8 +88,8 @@ int main(int argc, char **argv)
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
- g_main_loop_run(main_loop);
- g_main_loop_unref(main_loop);
+ event_loop->Run();
mpd_inotify_source_free(source);
+ delete event_loop;
}