chiark / gitweb /
util: define union dirent_storage and make use of it everywhere
[elogind.git] / src / shared / hwclock.c
index d9d5600ff34052db0bc03b5075a6e1ddcf24e71e..b93855d95704388d4c0a2568b2c679d82fe507a5 100644 (file)
@@ -61,10 +61,11 @@ static int rtc_open(int flags) {
 
         for (;;) {
                 char *p, *v;
-                struct dirent buf, *de;
+                struct dirent *de;
+                union dirent_storage buf;
                 int r;
 
-                r = readdir_r(d, &buf, &de);
+                r = readdir_r(d, &buf.de, &de);
                 if (r != 0)
                         goto fallback;
 
@@ -154,6 +155,7 @@ int hwclock_set_time(const struct tm *tm) {
 
         return err;
 }
+
 int hwclock_is_localtime(void) {
         FILE *f;
         bool local = false;