From 91d74375b92015bdea369a55703ae430d6002dca Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Sun, 20 Jun 2010 18:03:34 -0300 Subject: [PATCH] Open files in binary mode --- manifest.c | 2 +- util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.3