From: Jens Axboe Date: Wed, 14 Mar 2007 08:39:06 +0000 (+0100) Subject: recurse_dir(): Move . and .. check earlier X-Git-Tag: fio-1.14~4 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e85b2b83e39b64ba5cb73fbfddbf3902b6e84925;hp=96d32d518a0743a6c050057bc1562e4883e51c5d recurse_dir(): Move . and .. check earlier Signed-off-by: Jens Axboe --- 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; }