aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_inotify.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-24 14:44:08 +0100
committerMax Kellermann <max@duempel.org>2013-12-24 14:44:08 +0100
commit1ad52f131c7adf3396ea03d8da0da807da222bba (patch)
tree7556fa5d25352a5166342cbd582e62f473644123 /test/run_inotify.cxx
parent8064bbbc3f3d3bac50a9cd972106479fd32917cc (diff)
downloadmpd-1ad52f131c7adf3396ea03d8da0da807da222bba.tar.gz
mpd-1ad52f131c7adf3396ea03d8da0da807da222bba.tar.xz
mpd-1ad52f131c7adf3396ea03d8da0da807da222bba.zip
test/*: use fprintf(stderr,...) and Log() instead of g_printerr()
Avoid GLib.
Diffstat (limited to 'test/run_inotify.cxx')
-rw-r--r--test/run_inotify.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx
index c57e6e9ef..8dcc371cc 100644
--- a/test/run_inotify.cxx
+++ b/test/run_inotify.cxx
@@ -24,8 +24,6 @@
#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,8 +45,8 @@ 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];
@@ -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;
}