summaryrefslogtreecommitdiff
path: root/src/shred.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-07-11 18:30:02 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-07-11 18:30:02 +0000
commitbdc138f474c9ba15b948096a5d17918c712237ed (patch)
tree5490c580062056e99d154a4201c68396b836f3a5 /src/shred.c
parentaa43a635c1041fe5b540ed72142bd079e92339f8 (diff)
downloadcoreutils-bdc138f474c9ba15b948096a5d17918c712237ed.tar.xz
(wipefile): Always use binary mode. Clearly this
never worked right on DOS!
Diffstat (limited to 'src/shred.c')
-rw-r--r--src/shred.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shred.c b/src/shred.c
index 8a1d114bd..ebe6e06ea 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -1442,11 +1442,11 @@ wipefile (char *name, char const *qname,
bool ok;
int fd;
- fd = open (name, O_WRONLY | O_NOCTTY);
+ fd = open (name, O_WRONLY | O_NOCTTY | O_BINARY);
if (fd < 0
&& (errno == EACCES && flags->force)
&& chmod (name, S_IWUSR) == 0)
- fd = open (name, O_WRONLY | O_NOCTTY);
+ fd = open (name, O_WRONLY | O_NOCTTY | O_BINARY);
if (fd < 0)
{
error (0, errno, _("%s: failed to open for writing"), qname);