recurse_dir(): Move . and .. check earlier
[fio.git] / filesetup.c
index 3bd8633873cb7c40cb99c284a2d3ad7fdebadf4f..0f1a3402237a265d2480b5e865837938959ad6c1 100644 (file)
@@ -519,9 +519,8 @@ static int recurse_dir(struct thread_data *td, const char *dirname)
                char full_path[PATH_MAX];
                struct stat sb;
 
                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);
 
 
                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;
                }
 
                        continue;
                }
 
-               if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
-                       continue;
-
                if ((ret = recurse_dir(td, full_path)) != 0)
                        break;
        }
                if ((ret = recurse_dir(td, full_path)) != 0)
                        break;
        }