diff options
Diffstat (limited to '')
-rw-r--r-- | test/read_conf.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/read_conf.c b/test/read_conf.c index 286ec2c77..4f43e6a2e 100644 --- a/test/read_conf.c +++ b/test/read_conf.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2009 The Music Player Daemon Project + * Copyright (C) 2003-2010 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,6 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "config.h" #include "conf.h" #include <glib.h> @@ -37,6 +38,8 @@ my_log_func(G_GNUC_UNUSED const gchar *log_domain, int main(int argc, char **argv) { const char *path, *name, *value; + GError *error = NULL; + bool success; int ret; if (argc != 3) { @@ -50,7 +53,12 @@ int main(int argc, char **argv) g_log_set_default_handler(my_log_func, NULL); config_global_init(); - config_read_file(path); + success = config_read_file(path, &error); + if (!success) { + g_printerr("%s:", error->message); + g_error_free(error); + return 1; + } value = config_get_string(name, NULL); if (value != NULL) { |