]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(wipefile): Always use binary mode. Clearly this
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Jul 2005 18:30:02 +0000 (18:30 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Jul 2005 18:30:02 +0000 (18:30 +0000)
never worked right on DOS!

src/shred.c

index 8a1d114bd2ac0ef44622388a68e775f445cfc216..ebe6e06ea7f85be860e7a511a4c84b56de851599 100644 (file)
@@ -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);