diff options
author | Ron Yorston <rmy@pobox.com> | 2018-02-22 12:03:37 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-02-22 12:03:37 +0000 |
commit | 967510df361e0af44d7ca492ae2374674a535023 (patch) | |
tree | de8134e812a7836024064911a2b211a43d354dd4 /coreutils | |
parent | 227c119c93f8acd299e4e3c8b9601e67f000fb53 (diff) | |
download | busybox-w32-967510df361e0af44d7ca492ae2374674a535023.tar.gz busybox-w32-967510df361e0af44d7ca492ae2374674a535023.tar.bz2 busybox-w32-967510df361e0af44d7ca492ae2374674a535023.zip |
shred: fix up for WIN32 and enable by default
Use the new low-level support for /dev/zero and /dev/urandom to
allow shred to work in busybox-w32.
The only change required is to close the file before unlinking it,
as Microsoft Windows won't delete an open file.
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/shred.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 | } |