diff options
author | kremlin <ian@kremlin.cc> | 2014-08-06 15:09:11 +0800 |
---|---|---|
committer | kremlin <ian@kremlin.cc> | 2014-08-06 15:09:11 +0800 |
commit | 82a6a0d88fbf12bed60088c60db05d1f40b54994 (patch) | |
tree | 04879fc02c2bb0b3c5125fa8ee118afe2991c45f | |
parent | 8e18351c48d174484757d98f22bbf3bb0eee7e11 (diff) | |
download | systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.tar systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.tar.gz systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.tar.bz2 systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.tar.lz systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.tar.xz systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.tar.zst systembsd-82a6a0d88fbf12bed60088c60db05d1f40b54994.zip |
minor, clean up last commit to compile with strict flags
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.c | 10 | ||||
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.h | 2 |
2 files changed, 7 insertions, 5 deletions
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(); |