bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm: don't waste time preprocessing on tmpfs or nfs


From: Eric Blake
Subject: Re: rm: don't waste time preprocessing on tmpfs or nfs
Date: Wed, 01 Oct 2008 20:59:31 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 10/1/2008 2:42 PM:
>> Since we've already applied 58aaf71 to silence other functions when d_type is
>> unavailable (and sorting is useless), it seems like that needs to be repeated
>> here.  The constants from "fs.h" are not defined, since that file is valid 
>> only
>> for Linux and Hurd, but commenting out the entire function bypasses that
>> problem.
> 
> Hi Eric,
> 
> Thanks for reporting that.
> 
> In looking into it, I spotted a minor problem:
> the code was including sys/statfs.h, yet testing-for/guarding-with
> sys/vfs.h (as is documented for fstatfs on gnu/linux).
> I've fixed that and removed an unnecessary "defined".
> 
> To address your immediate problem, I've copied the constants for now,
> and will sync up fts.c tomorrow.  Or get tired enough of this
> duplication and make a module out of it.  Eventually I'll make
> it more portable (like for the Hurd).

I was thinking something more like the following (plus a .gitignore update):

$ git fetch git://repo.or.cz/coreutils/ericb.git master

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjkORIACgkQ84KuGfSFAYCjKACfWinF3fESmxds1U0fGytLuldv
6ngAoIaT29wOU9lUGO2cn0c9ddVg625R
=c0+f
-----END PGP SIGNATURE-----
>From ebcf737b37d97c264d13dfd95af6701970104076 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 1 Oct 2008 20:52:16 -0600
Subject: [PATCH] remove.c: allow compilation on cygwin

* src/remove.c (dirent_inode_sort_may_be_useful)
[!HAVE_STRUCT_DIRENT_D_TYPE]: Elide definition when there is no point
in trying to use it.

Signed-off-by: Eric Blake <address@hidden>
---
 src/remove.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/remove.c b/src/remove.c
index 30931b0..9bcd6f7 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -1275,11 +1275,10 @@ dirent_count (struct stat const *st)
 {
   return st->st_size / 16;
 }
-#endif /* HAVE_STRUCT_DIRENT_D_TYPE */
 
-#if defined HAVE_SYS_VFS_H && HAVE_FSTATFS && HAVE_STRUCT_STATFS_F_TYPE
-# include <sys/statfs.h>
-# include "fs.h"
+# if HAVE_SYS_VFS_H && HAVE_FSTATFS && HAVE_STRUCT_STATFS_F_TYPE
+#  include <sys/vfs.h>
+#  include "fs.h"
 
 /* Return false if it is easy to determine the file system type of
    the directory on which DIR_FD is open, and sorting dirents on
@@ -1313,9 +1312,10 @@ dirent_inode_sort_may_be_useful (int dir_fd)
       return true;
     }
 }
-#else
+# else /* !HAVE_STRUCT_STATFS_F_TYPE */
 static bool dirent_inode_sort_may_be_useful (int dir_fd) { return true; }
-#endif
+# endif /* !HAVE_STRUCT_STATFS_F_TYPE */
+#endif /* HAVE_STRUCT_DIRENT_D_TYPE */
 
 /* When a directory contains very many entries, operating on N entries in
    readdir order can be very seek-intensive (be it to unlink or even to
-- 
1.6.0.2


>From 76d516c57195facee1ad95e018fa47636ff8cf61 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 1 Oct 2008 20:53:46 -0600
Subject: [PATCH] ignore additional built file

Signed-off-by: Eric Blake <address@hidden>
---
 src/.gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/.gitignore b/src/.gitignore
index ed3111f..ac91e1d 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -39,6 +39,7 @@ hostname
 id
 join
 kill
+libver.a
 link
 ln
 localedir.h
-- 
1.6.0.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]