aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configs/mingw32_defconfig2
-rw-r--r--configs/mingw64_defconfig2
-rw-r--r--coreutils/shred.c6
3 files changed, 8 insertions, 2 deletions
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig
index 5a17fb164..7c56866a2 100644
--- a/configs/mingw32_defconfig
+++ b/configs/mingw32_defconfig
@@ -283,7 +283,7 @@ CONFIG_PWD=y
283CONFIG_RM=y 283CONFIG_RM=y
284CONFIG_RMDIR=y 284CONFIG_RMDIR=y
285CONFIG_SEQ=y 285CONFIG_SEQ=y
286# CONFIG_SHRED is not set 286CONFIG_SHRED=y
287CONFIG_SHUF=y 287CONFIG_SHUF=y
288CONFIG_SLEEP=y 288CONFIG_SLEEP=y
289CONFIG_FEATURE_FANCY_SLEEP=y 289CONFIG_FEATURE_FANCY_SLEEP=y
diff --git a/configs/mingw64_defconfig b/configs/mingw64_defconfig
index 7460e9860..3261d17b8 100644
--- a/configs/mingw64_defconfig
+++ b/configs/mingw64_defconfig
@@ -283,7 +283,7 @@ CONFIG_PWD=y
283CONFIG_RM=y 283CONFIG_RM=y
284CONFIG_RMDIR=y 284CONFIG_RMDIR=y
285CONFIG_SEQ=y 285CONFIG_SEQ=y
286# CONFIG_SHRED is not set 286CONFIG_SHRED=y
287CONFIG_SHUF=y 287CONFIG_SHUF=y
288CONFIG_SLEEP=y 288CONFIG_SLEEP=y
289CONFIG_FEATURE_FANCY_SLEEP=y 289CONFIG_FEATURE_FANCY_SLEEP=y
diff --git a/coreutils/shred.c b/coreutils/shred.c
index 3ceb58d19..1b65a359e 100644
--- a/coreutils/shred.c
+++ b/coreutils/shred.c
@@ -96,8 +96,14 @@ int shred_main(int argc UNUSED_PARAM, char **argv)
96 } 96 }
97 if (opt & OPT_u) { 97 if (opt & OPT_u) {
98 ftruncate(fd, 0); 98 ftruncate(fd, 0);
99#if ENABLE_PLATFORM_MINGW32
100 xclose(fd);
101#endif
99 xunlink(fname); 102 xunlink(fname);
100 } 103 }
104#if ENABLE_PLATFORM_MINGW32
105 else
106#endif
101 xclose(fd); 107 xclose(fd);
102 } 108 }
103 } 109 }