make SetStaticHostname() call sethostname()
authorkremlin <ian@kremlin.cc>
Thu, 21 Aug 2014 04:01:50 +0000 (23:01 -0500)
committerkremlin <ian@kremlin.cc>
Thu, 21 Aug 2014 04:01:50 +0000 (23:01 -0500)
src/interfaces/hostnamed/hostnamed.c

index 3f63e0a027416128ac3f12fb495ff1dc573a27b3..ec7156f1bab6502e72d8e71b140ebf231e358872 100644 (file)
@@ -256,9 +256,9 @@ on_handle_set_static_hostname(Hostname1 *hn1_passed_interf,
         } else { 
 
             g_strdelimit(STATIC_HOSTNAME, " ", '-');
-            hostname1_set_static_hostname(hn1_passed_interf, STATIC_HOSTNAME);
+            hostname1_set_static_hostname(hn1_passed_interf, STATIC_HOSTNAME); 
             g_ptr_array_add(hostnamed_freeable, valid_static_hostname_buf);
-            ret = TRUE;
+            ret = (!sethostname(valid_static_hostname_buf, MAXHOSTNAMELEN)) ? TRUE : FALSE; /* TODO set /etc/myname, guarantee domain or substitue .home.network" */
             hostname1_complete_set_static_hostname(hn1_passed_interf, invoc);
         }
     }