summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2014-01-19 17:37:17 +0100
committerDaniel Carl <danielcarl@gmx.de>2014-01-19 17:37:17 +0100
commit5911734aedaec352eca81a6da24148587cb3103a (patch)
tree5a32b8438db036b0661553af56483a39834f3107 /src/util.c
parentafcdae37b3184eac69de8f0871bae12131769608 (diff)
Use message logging function instead of fprintf.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index 6e69b40..c368991 100644
--- a/src/util.c
+++ b/src/util.c
@@ -76,7 +76,7 @@ char *util_get_file_contents(const char *filename, gsize *length)
if (!(g_file_test(filename, G_FILE_TEST_IS_REGULAR)
&& g_file_get_contents(filename, &content, length, &error))
) {
- fprintf(stderr, "Cannot open %s: %s\n", filename, error ? error->message : "file not found");
+ g_warning("Cannot open %s: %s", filename, error ? error->message : "file not found");
g_clear_error(&error);
}
return content;
@@ -268,7 +268,7 @@ gboolean util_create_tmp_file(const char *content, char **file)
fp = g_file_open_tmp(PROJECT "-XXXXXX", file, NULL);
if (fp == -1) {
- fprintf(stderr, "Could not create temporary file %s", *file);
+ g_critical("Could not create temp file %s", *file);
g_free(*file);
return false;
}
@@ -280,7 +280,7 @@ gboolean util_create_tmp_file(const char *content, char **file)
if (bytes < len) {
close(fp);
unlink(*file);
- fprintf(stderr, "Could not write temporary file %s", *file);
+ g_critical("Could not write temp file %s", *file);
g_free(*file);
return false;