aboutsummaryrefslogtreecommitdiff
path: root/coreutils/shred.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/shred.c')
-rw-r--r--coreutils/shred.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/coreutils/shred.c b/coreutils/shred.c
index 8f3d9c5c9..86d4b66b4 100644
--- a/coreutils/shred.c
+++ b/coreutils/shred.c
@@ -38,6 +38,10 @@
38 38
39#include "libbb.h" 39#include "libbb.h"
40 40
41#if ENABLE_PLATFORM_MINGW32
42#define xopen mingw_xopen
43#endif
44
41int shred_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 45int shred_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
42int shred_main(int argc UNUSED_PARAM, char **argv) 46int shred_main(int argc UNUSED_PARAM, char **argv)
43{ 47{
@@ -96,8 +100,14 @@ int shred_main(int argc UNUSED_PARAM, char **argv)
96 } 100 }
97 if (opt & OPT_u) { 101 if (opt & OPT_u) {
98 ftruncate(fd, 0); 102 ftruncate(fd, 0);
103#if ENABLE_PLATFORM_MINGW32
104 xclose(fd);
105#endif
99 xunlink(fname); 106 xunlink(fname);
100 } 107 }
108#if ENABLE_PLATFORM_MINGW32
109 else
110#endif
101 xclose(fd); 111 xclose(fd);
102 } 112 }
103 } 113 }