summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Youngman <jay@gnu.org>2011-06-11 16:53:32 +0100
committerJames Youngman <jay@gnu.org>2011-06-11 17:07:11 +0100
commita0c61bf45cb14e408caccc561f6d99e7ddda004e (patch)
treea9fc1e9b0d0c089c758ec35531df9d96624c3244
parente338e2c9db2a2e6bc45688c6b06fec4928da229e (diff)
downloadfindutils-a0c61bf45cb14e408caccc561f6d99e7ddda004e.tar.gz
Adopt the new gnulib module stat-size.
* lib/listfile.c: Include "stat-size.h". Delete the DEV_BSIZE, ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE macros which are now in stat-size.h. * gnulib: Update to latest. * import-gnulib.config (modules): Add stat-size.
-rw-r--r--ChangeLog9
m---------gnulib0
-rw-r--r--import-gnulib.config1
-rw-r--r--lib/listfile.c65
4 files changed, 11 insertions, 64 deletions
diff --git a/ChangeLog b/ChangeLog
index 70d8cd4b..3b23122e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-06-11 James Youngman <jay@gnu.org>
+
+ Adopt the new gnulib module stat-size.
+ * lib/listfile.c: Include "stat-size.h". Delete the DEV_BSIZE,
+ ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE macros which are now in
+ stat-size.h.
+ * gnulib: Update to latest.
+ * import-gnulib.config (modules): Add stat-size.
+
2011-06-05 James Youngman <jay@gnu.org>
Don't include sys/param.h where we don't need it.
diff --git a/gnulib b/gnulib
-Subproject 23b18247253c80345d5fcf7173c5b734b0b8f43
+Subproject 9fc77bc59374e21e1174742df416af186a368e1
diff --git a/import-gnulib.config b/import-gnulib.config
index 3c37ed45..5fb46c21 100644
--- a/import-gnulib.config
+++ b/import-gnulib.config
@@ -119,6 +119,7 @@ selinux-at
snprintf
stat
stat-macros
+stat-size
stat-time
stdarg
stdbool
diff --git a/lib/listfile.c b/lib/listfile.c
index e7780c92..2e94bf6a 100644
--- a/lib/listfile.c
+++ b/lib/listfile.c
@@ -40,6 +40,7 @@
#include "filemode.h"
#include "idcache.h"
#include "areadlink.h"
+#include "stat-size.h"
#include "listfile.h"
@@ -53,70 +54,6 @@
#define HAVE_MAJOR
#endif
-
-
-/* Get or fake the disk device blocksize.
- Usually defined by sys/param.h (if at all). */
-#include <sys/param.h>
-#ifndef DEV_BSIZE
-# ifdef BSIZE
-# define DEV_BSIZE BSIZE
-# else /* !BSIZE */
-# define DEV_BSIZE 4096
-# endif /* !BSIZE */
-#endif /* !DEV_BSIZE */
-
-/* Extract or fake data from a `struct stat'.
- ST_BLKSIZE: Preferred I/O blocksize for the file, in bytes.
- ST_NBLOCKS: Number of blocks in the file, including indirect blocks.
- ST_NBLOCKSIZE: Size of blocks used when calculating ST_NBLOCKS. */
-#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
-# define ST_BLKSIZE(statbuf) DEV_BSIZE
-# if defined _POSIX_SOURCE || !defined BSIZE /* fileblocks.c uses BSIZE. */
-# define ST_NBLOCKS(statbuf) \
- (S_ISREG ((statbuf).st_mode) \
- || S_ISDIR ((statbuf).st_mode) \
- ? (statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0) : 0)
-# else /* !_POSIX_SOURCE && BSIZE */
-# define ST_NBLOCKS(statbuf) \
- (S_ISREG ((statbuf).st_mode) \
- || S_ISDIR ((statbuf).st_mode) \
- ? st_blocks ((statbuf).st_size) : 0)
-# endif /* !_POSIX_SOURCE && BSIZE */
-#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
-/* Some systems, like Sequents, return st_blksize of 0 on pipes. */
-# define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
- ? (statbuf).st_blksize : DEV_BSIZE)
-# if defined hpux || defined __hpux__ || defined __hpux
-/* HP-UX counts st_blocks in 1024-byte units.
- This loses when mixing HP-UX and BSD filesystems with NFS. */
-# define ST_NBLOCKSIZE 1024
-# else /* !hpux */
-# if defined _AIX && defined _I386
-/* AIX PS/2 counts st_blocks in 4K units. */
-# define ST_NBLOCKSIZE (4 * 1024)
-# else /* not AIX PS/2 */
-# if defined _CRAY
-# define ST_NBLOCKS(statbuf) \
- (S_ISREG ((statbuf).st_mode) \
- || S_ISDIR ((statbuf).st_mode) \
- ? (statbuf).st_blocks * ST_BLKSIZE(statbuf)/ST_NBLOCKSIZE : 0)
-# endif /* _CRAY */
-# endif /* not AIX PS/2 */
-# endif /* !hpux */
-#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
-
-#ifndef ST_NBLOCKS
-# define ST_NBLOCKS(statbuf) \
- (S_ISREG ((statbuf).st_mode) \
- || S_ISDIR ((statbuf).st_mode) \
- ? (statbuf).st_blocks : 0)
-#endif
-
-#ifndef ST_NBLOCKSIZE
-# define ST_NBLOCKSIZE 512
-#endif
-
#ifdef major /* Might be defined in sys/types.h. */
#define HAVE_MAJOR
#endif