add NTP property code. and timedated is done! (except for undocumented properties)
authorkremlin <ian@kremlin.cc>
Wed, 15 Oct 2014 02:36:48 +0000 (22:36 -0400)
committerkremlin <ian@kremlin.cc>
Wed, 15 Oct 2014 02:36:48 +0000 (22:36 -0400)
src/interfaces/timedated/timedated.c

index 59ed12bc60b3c32f31208eb75e6e1182288b9631..dfe5b7347c4a67b2591427909b17ecc4a97dbf34 100644 (file)
@@ -396,9 +396,7 @@ our_get_timezone() {
         if(hash_to_match)
             g_free(hash_to_match);
     }
-
-    
-
     return ret;
 }
 
@@ -422,9 +420,18 @@ our_get_can_ntp() {
 gboolean
 our_get_ntp() {
  
-    const gboolean ret = FALSE;
+    int system_ret;
 
-    return ret;
+    if((system_ret = system("rcctl check ntpd > /dev/null 2>&1")) == -1) {
+
+        g_printf("failed to check NTP status with rcctl\n");
+        return FALSE;
+    }
+
+    if(system_ret)
+        return FALSE;
+
+    return TRUE;
 }
 
 gboolean