chiark / gitweb /
logind: support for hybrid sleep (i.e. suspend+hibernate at the same time)
[elogind.git] / src / shared / conf-files.c
index 83e4cce15617ef89760b019c722127e52bf4e3a5..34b86293d3a246b9703a36eab41f8f020de4ff38 100644 (file)
@@ -39,7 +39,6 @@
 
 static int files_add(Hashmap *h, const char *path, const char *suffix) {
         DIR *dir;
-        struct dirent buffer, *de;
         int r = 0;
 
         dir = opendir(path);
@@ -50,10 +49,12 @@ static int files_add(Hashmap *h, const char *path, const char *suffix) {
         }
 
         for (;;) {
+                struct dirent *de;
+                union dirent_storage buf;
                 int k;
                 char *p;
 
-                k = readdir_r(dir, &buffer, &de);
+                k = readdir_r(dir, &buf.de, &de);
                 if (k != 0) {
                         r = -k;
                         goto finish;