diff options
author | Ron Yorston <rmy@pobox.com> | 2012-11-29 10:29:32 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-11-29 10:29:32 +0000 |
commit | 7e6a84d77b53451498d31c4b621a7ba55a8f7db6 (patch) | |
tree | a3779f5004626febc08533433cb635d9b1356771 | |
parent | 45c0070a259132f13424ba2ff42ea523c4fd318a (diff) | |
download | busybox-w32-7e6a84d77b53451498d31c4b621a7ba55a8f7db6.tar.gz busybox-w32-7e6a84d77b53451498d31c4b621a7ba55a8f7db6.tar.bz2 busybox-w32-7e6a84d77b53451498d31c4b621a7ba55a8f7db6.zip |
du: enable for MINGW with fake block count
-rw-r--r-- | configs/mingw32_defconfig | 6 | ||||
-rw-r--r-- | coreutils/du.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig index 94380c22f..7ed14c40b 100644 --- a/configs/mingw32_defconfig +++ b/configs/mingw32_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Busybox version: 1.21.0.git | 3 | # Busybox version: 1.21.0.git |
4 | # Wed Oct 10 13:02:18 2012 | 4 | # Thu Nov 29 10:22:19 2012 |
5 | # | 5 | # |
6 | CONFIG_HAVE_DOT_CONFIG=y | 6 | CONFIG_HAVE_DOT_CONFIG=y |
7 | # CONFIG_PLATFORM_POSIX is not set | 7 | # CONFIG_PLATFORM_POSIX is not set |
@@ -215,8 +215,8 @@ CONFIG_FEATURE_DD_IBS_OBS=y | |||
215 | CONFIG_DIRNAME=y | 215 | CONFIG_DIRNAME=y |
216 | CONFIG_DOS2UNIX=y | 216 | CONFIG_DOS2UNIX=y |
217 | CONFIG_UNIX2DOS=y | 217 | CONFIG_UNIX2DOS=y |
218 | # CONFIG_DU is not set | 218 | CONFIG_DU=y |
219 | # CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set | 219 | CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y |
220 | CONFIG_ECHO=y | 220 | CONFIG_ECHO=y |
221 | CONFIG_FEATURE_FANCY_ECHO=y | 221 | CONFIG_FEATURE_FANCY_ECHO=y |
222 | CONFIG_ENV=y | 222 | CONFIG_ENV=y |
diff --git a/coreutils/du.c b/coreutils/du.c index 19a0319f1..04e78f982 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -127,7 +127,11 @@ static unsigned long long du(const char *filename) | |||
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | #if !ENABLE_PLATFORM_MINGW32 | ||
130 | sum = statbuf.st_blocks; | 131 | sum = statbuf.st_blocks; |
132 | #else | ||
133 | sum = (statbuf.st_size+511)/512; | ||
134 | #endif | ||
131 | 135 | ||
132 | if (S_ISLNK(statbuf.st_mode)) { | 136 | if (S_ISLNK(statbuf.st_mode)) { |
133 | if (G.slink_depth > G.du_depth) { /* -H or -L */ | 137 | if (G.slink_depth > G.du_depth) { /* -H or -L */ |
@@ -136,7 +140,11 @@ static unsigned long long du(const char *filename) | |||
136 | G.status = EXIT_FAILURE; | 140 | G.status = EXIT_FAILURE; |
137 | return 0; | 141 | return 0; |
138 | } | 142 | } |
143 | #if !ENABLE_PLATFORM_MINGW32 | ||
139 | sum = statbuf.st_blocks; | 144 | sum = statbuf.st_blocks; |
145 | #else | ||
146 | sum = (statbuf.st_size+511)/512; | ||
147 | #endif | ||
140 | if (G.slink_depth == 1) { | 148 | if (G.slink_depth == 1) { |
141 | /* Convert -H to -L */ | 149 | /* Convert -H to -L */ |
142 | G.slink_depth = INT_MAX; | 150 | G.slink_depth = INT_MAX; |