osl.c for_each_file_in_dir(): Move struct stat to inner loop.
[paraslash.git] / osl.c
diff --git a/osl.c b/osl.c
index b1aaf3e5060b5f07ed9d61cbf02a2e0b66359510..7f6ffdb9094a4b4deb12c49a876f6118a05473e5 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -267,7 +267,6 @@ int for_each_file_in_dir(const char *dirname,
         * and calling chdir() afterwards (see man 3 getcwd).
         */
        int cwd_fd = open(".", O_RDONLY);
-       struct stat s;
        int ret = -1;
 
 //     PARA_DEBUG_LOG("dirname: %s\n", dirname);
@@ -284,6 +283,7 @@ int for_each_file_in_dir(const char *dirname,
        while ((entry = readdir(dir))) {
                mode_t m;
                char *tmp;
+               struct stat s;
 
                if (!strcmp(entry->d_name, "."))
                        continue;