summaryrefslogtreecommitdiff
path: root/test/run_inotify.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-14 09:52:35 +0100
committerMax Kellermann <max@duempel.org>2013-01-14 10:08:26 +0100
commit8e3982dd422671d26a653f393639cd12cd01ff18 (patch)
tree3a2bca08d49b5f85d840c6351f19d353626afa0d /test/run_inotify.cxx
parente83f805b8fa34db8ac0b885d3fb78c0e6437c908 (diff)
InotifySource: convert to a class
Diffstat (limited to 'test/run_inotify.cxx')
-rw-r--r--test/run_inotify.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx
index 7052210b1..92790a3a3 100644
--- a/test/run_inotify.cxx
+++ b/test/run_inotify.cxx
@@ -61,19 +61,17 @@ int main(int argc, char **argv)
path = argv[1];
- struct mpd_inotify_source *source =
- mpd_inotify_source_new(my_inotify_callback, NULL,
- &error);
+ InotifySource *source = InotifySource::Create(my_inotify_callback,
+ nullptr, &error);
if (source == NULL) {
g_warning("%s", error->message);
g_error_free(error);
return 2;
}
- int descriptor = mpd_inotify_source_add(source, path,
- IN_MASK, &error);
+ int descriptor = source->Add(path, IN_MASK, &error);
if (descriptor < 0) {
- mpd_inotify_source_free(source);
+ delete source;
g_warning("%s", error->message);
g_error_free(error);
return 2;
@@ -90,6 +88,6 @@ int main(int argc, char **argv)
event_loop->Run();
- mpd_inotify_source_free(source);
+ delete source;
delete event_loop;
}