From: kremlin Date: Wed, 6 Aug 2014 07:09:11 +0000 (-0500) Subject: minor, clean up last commit to compile with strict flags X-Git-Tag: gsoc-final~40 X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systembsd.git;a=commitdiff_plain;h=af14252f42dcdae4b0dcb6d66e34c27fa0776a09 minor, clean up last commit to compile with strict flags --- diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 38d811c..87401f1 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -106,17 +106,17 @@ our_get_hostname() { const gchar * our_get_static_hostname() { - gchar *pretty_hostname; - gchar *ret; + const gchar *pretty_hostname; + const gchar *ret; pretty_hostname = our_get_pretty_hostname(); if(g_strcmp0(pretty_hostname, "") == 0) ret = our_get_hostname(); - else if(ret = g_hostname_to_ascii(pretty_hostname)) { + else if((ret = g_hostname_to_ascii(pretty_hostname))) { - g_ptr_array_add(hostnamed_freeable, ret); + g_ptr_array_add(hostnamed_freeable, (gpointer)ret); return ret; } @@ -130,7 +130,7 @@ our_get_pretty_hostname() { gchar *ret; if(g_key_file_load_from_file(config, "/etc/systemd_compat.conf", G_KEY_FILE_NONE, NULL) - && ret = g_key_file_get_value(config, "hostnamed", "PrettyHostname", NULL)) { /* ret might need to be freed, docs dont specify but i am suspicious */ + && (ret = g_key_file_get_value(config, "hostnamed", "PrettyHostname", NULL))) { /* ret might need to be freed, docs dont specify but i am suspicious */ g_free(config); return ret; diff --git a/src/interfaces/hostnamed/hostnamed.h b/src/interfaces/hostnamed/hostnamed.h index 78c7501..590a783 100644 --- a/src/interfaces/hostnamed/hostnamed.h +++ b/src/interfaces/hostnamed/hostnamed.h @@ -15,3 +15,5 @@ */ void hostnamed_mem_clean(); + +const gchar *our_get_pretty_hostname();