chiark / gitweb /
build-sys: add a makefile target to run all tests through valgrind
[elogind.git] / src / timedate / timedated.c
index 4efa806c399d97f85136ad38dfe734d2789026b5..525c72e497728b9e1b15864f8ad4a8904dba31fc 100644 (file)
@@ -90,6 +90,8 @@ typedef struct TZ {
 } TZ;
 
 static TZ tz = {
+        .zone = NULL,
+        .local_rtc = false,
         .can_ntp = -1,
         .use_ntp = -1,
 };
@@ -216,7 +218,7 @@ static int write_data_timezone(void) {
 
 static int write_data_local_rtc(void) {
         int r;
-        char _cleanup_free_ *s = NULL, *w = NULL;
+        _cleanup_free_ char *s = NULL, *w = NULL;
 
         r = read_full_file("/etc/adjtime", &s, NULL);
         if (r < 0) {
@@ -268,7 +270,7 @@ static int write_data_local_rtc(void) {
 }
 
 static char** get_ntp_services(void) {
-        char _cleanup_strv_free_ **r = NULL, **files;
+        _cleanup_strv_free_ char **r = NULL, **files;
         char **i;
         int k;
 
@@ -282,7 +284,7 @@ static char** get_ntp_services(void) {
                 return NULL;
 
         STRV_FOREACH(i, files) {
-                FILE _cleanup_fclose_ *f;
+                _cleanup_fclose_ FILE *f;
 
                 f = fopen(*i, "re");
                 if (!f)
@@ -303,9 +305,10 @@ static char** get_ntp_services(void) {
                         if (l[0] == 0 || l[0] == '#')
                                 continue;
 
-                        if (strv_extend(&r, l) < 0)
+                        if (strv_extend(&r, l) < 0) {
                                 log_oom();
-                        return NULL;
+                                return NULL;
+                        }
                 }
         }
 
@@ -659,7 +662,7 @@ static DBusHandlerResult timedate_message_handler(
                                 return bus_send_error_reply(connection, message, NULL, r);
                         }
 
-                        /* 2. Tell the kernel our time zone */
+                        /* 2. Tell the kernel our timezone */
                         hwclock_set_timezone(NULL);
 
                         if (tz.local_rtc) {
@@ -716,7 +719,7 @@ static DBusHandlerResult timedate_message_handler(
                                 return bus_send_error_reply(connection, message, NULL, r);
                         }
 
-                        /* 2. Tell the kernel our time zone */
+                        /* 2. Tell the kernel our timezone */
                         hwclock_set_timezone(NULL);
 
                         /* 3. Synchronize clocks */