]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Open files in binary mode
authorRamiro Polla <ramiro.polla@gmail.com>
Sun, 20 Jun 2010 21:03:34 +0000 (18:03 -0300)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 25 Jun 2010 08:33:54 +0000 (10:33 +0200)
manifest.c
util.c

index 24c74d7439fb1d7934b4a6b7f27aae1bf3e8887f..4ba19c7772f28dfe115603817e0a1be5ef2fda46 100644 (file)
@@ -546,7 +546,7 @@ struct file_hash *manifest_get(const char *manifest_path)
        uint32_t i;
        struct file_hash *fh = NULL;
 
-       fd = open(manifest_path, O_RDONLY);
+       fd = open(manifest_path, O_RDONLY | O_BINARY);
        if (fd == -1) {
                /* Cache miss. */
                goto out;
diff --git a/util.c b/util.c
index 17996fab12e99df51b6fab6b2387576fde96abf6..6f7c781d378d13d77e03ef13209554b2435238e3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -189,7 +189,7 @@ int copy_file(const char *src, const char *dest, int compress_dest)
               src, dest, compress_dest ? "compressed": "uncompressed");
 
        /* open source file */
-       fd_in = open(src, O_RDONLY);
+       fd_in = open(src, O_RDONLY | O_BINARY);
        if (fd_in == -1) {
                cc_log("open error: %s", strerror(errno));
                return -1;