aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_inotify.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/run_inotify.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx
index c57e6e9ef..df4046356 100644
--- a/test/run_inotify.cxx
+++ b/test/run_inotify.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -19,13 +19,11 @@
#include "config.h"
#include "ShutdownHandler.hxx"
-#include "InotifySource.hxx"
+#include "db/update/InotifySource.hxx"
#include "event/Loop.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
-#include <glib.h>
-
#include <sys/inotify.h>
static constexpr unsigned IN_MASK =
@@ -39,7 +37,7 @@ static void
my_inotify_callback(gcc_unused int wd, unsigned mask,
const char *name, gcc_unused void *ctx)
{
- g_print("mask=0x%x name='%s'\n", mask, name);
+ printf("mask=0x%x name='%s'\n", mask, name);
}
int main(int argc, char **argv)
@@ -47,13 +45,13 @@ int main(int argc, char **argv)
const char *path;
if (argc != 2) {
- g_printerr("Usage: run_inotify PATH\n");
- return 1;
+ fprintf(stderr, "Usage: run_inotify PATH\n");
+ return EXIT_FAILURE;
}
path = argv[1];
- EventLoop event_loop((EventLoop::Default()));
+ EventLoop event_loop;
const ShutdownHandler shutdown_handler(event_loop);
Error error;
@@ -62,17 +60,18 @@ int main(int argc, char **argv)
nullptr, error);
if (source == NULL) {
LogError(error);
- return 2;
+ return EXIT_FAILURE;
}
int descriptor = source->Add(path, IN_MASK, error);
if (descriptor < 0) {
delete source;
LogError(error);
- return 2;
+ return EXIT_FAILURE;
}
event_loop.Run();
delete source;
+ return EXIT_SUCCESS;
}