Browse Source

Report race on systems without O_DIRECTORY

* src/names.c (collect_and_sort_names): Report ENOTDIR after
successful fstat() but !S_ISDIR.
Pavel Raiskup 6 years ago
parent
commit
c1b569d9d6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/names.c

+ 5 - 0
src/names.c

@@ -1767,6 +1767,11 @@ collect_and_sort_names (void)
 		  name->found_count++;
 		  add_hierarchy_to_namelist (&st, name);
 		}
+	      else
+		{
+		  errno = ENOTDIR;
+		  open_diag (name->name);
+		}
 	    }
 	}