aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkremlin <ian@kremlin.cc>2014-08-06 15:09:11 +0800
committerkremlin <ian@kremlin.cc>2014-08-06 15:09:11 +0800
commitaf14252f42dcdae4b0dcb6d66e34c27fa0776a09 (patch)
tree04879fc02c2bb0b3c5125fa8ee118afe2991c45f
parenta2fffc07173bab908d10ac2d66f73d33f085c601 (diff)
downloadsystembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.tar
systembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.tar.gz
systembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.tar.bz2
systembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.tar.lz
systembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.tar.xz
systembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.tar.zst
systembsd-af14252f42dcdae4b0dcb6d66e34c27fa0776a09.zip
minor, clean up last commit to compile with strict flags
-rw-r--r--src/interfaces/hostnamed/hostnamed.c10
-rw-r--r--src/interfaces/hostnamed/hostnamed.h2
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();