int found = 0;
DIR *D;
+ /*
+ * If replay_redirect is set then always return this device
+ * upon lookup which overrides the device lookup based on
+ * major minor in the actual blktrace
+ */
+ if (redirect) {
+ strcpy(path, redirect);
+ return 1;
+ }
+
D = opendir(path);
if (!D)
return 0;
if (!S_ISBLK(st.st_mode))
continue;
- /*
- * If replay_redirect is set then always return this device
- * upon lookup which overrides the device lookup based on
- * major minor in the actual blktrace
- */
- if (redirect) {
- strcpy(path, redirect);
- found = 1;
- break;
- }
-
if (maj == major(st.st_rdev) && min == minor(st.st_rdev)) {
strcpy(path, full_path);
found = 1;