chiark / gitweb /
util: define union dirent_storage and make use of it everywhere
[elogind.git] / src / shared / hwclock.c
index 67eb2eff8b0782c0a650f6418dc08527949d836f..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;