summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-08-31 16:04:57 +0000
committerJim Meyering <jim@meyering.net>2002-08-31 16:04:57 +0000
commit62808a7fb5cbb2d321719c0cba558f2ce8c90d24 (patch)
tree19644f63d99075f9c6b32fda78c5eedd2fe2f009 /src
parent03b25d2e46f3f7c1a53e8107c6111f68739c55f4 (diff)
downloadcoreutils-62808a7fb5cbb2d321719c0cba558f2ce8c90d24.tar.xz
Symlinks were always reported as using 0 blocks.
(ST_NBLOCKS): Don't depend on file type. This reverts the change of 2000-01-30. Based on a report and patch from Neil Brown via Michael Stone.
Diffstat (limited to 'src')
-rw-r--r--src/system.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/system.h b/src/system.h
index a2c08d2f6..edf242116 100644
--- a/src/system.h
+++ b/src/system.h
@@ -246,9 +246,7 @@ typedef enum {false = 0, true = 1} bool;
# 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)
+ ((statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0))
# else /* !_POSIX_SOURCE && BSIZE */
# define ST_NBLOCKS(statbuf) \
(S_ISREG ((statbuf).st_mode) \
@@ -279,10 +277,7 @@ typedef enum {false = 0, true = 1} bool;
#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)
+# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks)
#endif
#ifndef ST_NBLOCKSIZE