summaryrefslogtreecommitdiff
path: root/test/read_conf.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-19 00:24:20 +0200
committerMax Kellermann <max@duempel.org>2011-07-19 00:24:20 +0200
commiteb2f413cf030a8c9ed51d8dc081e51e4afd287fb (patch)
tree47c1265e07af284e8a2ced6cb968b5359b754274 /test/read_conf.c
parente54748d3554d57f8320dff7390fa605bf23d7cd0 (diff)
parent736fd0e29326548152e91e4e3fb8c0ea9c1b50ac (diff)
Merge branch 'v0.16.x'
Conflicts: NEWS configure.ac
Diffstat (limited to 'test/read_conf.c')
-rw-r--r--test/read_conf.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/read_conf.c b/test/read_conf.c
index 255831c39..4f6005c6f 100644
--- a/test/read_conf.c
+++ b/test/read_conf.c
@@ -37,30 +37,28 @@ 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) {
g_printerr("Usage: read_conf FILE SETTING\n");
return 1;
}
- path = argv[1];
- name = argv[2];
+ const char *path = argv[1];
+ const char *name = argv[2];
g_log_set_default_handler(my_log_func, NULL);
config_global_init();
- success = config_read_file(path, &error);
+
+ GError *error = NULL;
+ bool 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);
+ const char *value = config_get_string(name, NULL);
+ int ret;
if (value != NULL) {
g_print("%s\n", value);
ret = 0;
@@ -70,5 +68,5 @@ int main(int argc, char **argv)
}
config_global_finish();
- return 0;
+ return ret;
}