Explorar o código

Fixed rm -r bug on FreeBSD

Michael van Elst %!s(int64=23) %!d(string=hai) anos
pai
achega
f7f0271136
Modificáronse 2 ficheiros con 27 adicións e 2 borrados
  1. 23 0
      coreutils/coreutils-dirent.patch
  2. 4 2
      coreutils/coreutils.spec

+ 23 - 0
coreutils/coreutils-dirent.patch

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

+ 4 - 2
coreutils/coreutils.spec

@@ -33,11 +33,12 @@ Distribution: OpenPKG [BASE]
 Group:        Utility
 License:      GPL
 Version:      4.5.4
-Release:      20030112
+Release:      20030117
 
 #   list of sources
 Source0:      ftp://alpha.gnu.org/gnu/coreutils/coreutils-%{version}.tar.bz2
 Patch0:       coreutils.patch
+Patch1:       coreutils-dirent.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -65,7 +66,8 @@ AutoReqProv:  no
 
 %prep
     %setup -q
-    %patch -p0
+    %patch0 -p0
+    %patch1 -p0
 
 %build
     CC="%{l_cc}" \