diff --git a/Utilities/cmtar/append.c b/Utilities/cmtar/append.c index 4350745185..5ad3593ed2 100644 --- a/Utilities/cmtar/append.c +++ b/Utilities/cmtar/append.c @@ -231,7 +231,7 @@ tar_append_regfile(TAR *t, char *realname) int i, j; size_t size; - filefd = open(realname, O_RDONLY); + filefd = open(realname, O_RDONLY | O_BINARY); if (filefd == -1) { #ifdef DEBUG diff --git a/Utilities/cmtar/libtar.c b/Utilities/cmtar/libtar.c index 7454a5c03c..cdbe7a136d 100644 --- a/Utilities/cmtar/libtar.c +++ b/Utilities/cmtar/libtar.c @@ -15,7 +15,7 @@ #include #include #include -#if !defined(_WIN32) || defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include #include #else