From: Andre Noll Date: Wed, 19 Sep 2007 21:09:41 +0000 (+0200) Subject: osl.c for_each_file_in_dir(): Move struct stat to inner loop. X-Git-Tag: v0.3.0~383^2~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=5f05aea3182a80a625c3ce15380136e682497be2 osl.c for_each_file_in_dir(): Move struct stat to inner loop. --- diff --git a/osl.c b/osl.c index b1aaf3e5..7f6ffdb9 100644 --- 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;