From e85b2b83e39b64ba5cb73fbfddbf3902b6e84925 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 14 Mar 2007 09:39:06 +0100 Subject: [PATCH 1/1] recurse_dir(): Move . and .. check earlier Signed-off-by: Jens Axboe --- filesetup.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/filesetup.c b/filesetup.c index 3bd86338..0f1a3402 100644 --- a/filesetup.c +++ b/filesetup.c @@ -519,9 +519,8 @@ static int recurse_dir(struct thread_data *td, const char *dirname) char full_path[PATH_MAX]; struct stat sb; - /* - * check d_ino here? - */ + if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..")) + continue; sprintf(full_path, "%s/%s", dirname, dir->d_name); @@ -538,9 +537,6 @@ static int recurse_dir(struct thread_data *td, const char *dirname) continue; } - if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..")) - continue; - if ((ret = recurse_dir(td, full_path)) != 0) break; } -- 2.25.1