From: Ramiro Polla Date: Sun, 20 Jun 2010 21:03:34 +0000 (-0300) Subject: Open files in binary mode X-Git-Tag: v3.1~209 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91d74375b92015bdea369a55703ae430d6002dca;p=thirdparty%2Fccache.git Open files in binary mode --- diff --git a/manifest.c b/manifest.c index 24c74d743..4ba19c777 100644 --- a/manifest.c +++ b/manifest.c @@ -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 17996fab1..6f7c781d3 100644 --- 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;