coreutils-dirent.patch 675 B

123456789101112131415161718192021222324
  1. --- src/remove.c.dist 2003-01-17 15:33:54.000000000 +0100
  2. +++ src/remove.c 2003-01-17 15:37:08.000000000 +0100
  3. @@ -632,9 +632,11 @@
  4. #if HAVE_STRUCT_DIRENT_D_TYPE
  5. # define DT_IS_DIR(D) ((D)->d_type == DT_DIR)
  6. +# define DT_IS_DEF(D) ((D)->d_type != DT_UNKNOWN)
  7. #else
  8. /* Use this only if the member exists -- i.e., don't return 0. */
  9. # define DT_IS_DIR(D) do_not_use_this_macro
  10. +# define DT_IS_DEF(D) do_not_use_this_macro
  11. #endif
  12. #define DO_UNLINK(Filename, X) \
  13. @@ -704,7 +706,7 @@
  14. if (is_dir == T_UNKNOWN)
  15. {
  16. # if HAVE_STRUCT_DIRENT_D_TYPE
  17. - if (dp)
  18. + if (dp && DT_IS_DEF (dp))
  19. is_dir = DT_IS_DIR (dp) ? T_YES : T_NO;
  20. else
  21. # endif