diff options
author | kientzle <kientzle@FreeBSD.org> | 2009-12-28 03:13:49 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2009-12-28 03:13:49 +0000 |
commit | 6bd62572798c824be47137cb168d851cdf613bfc (patch) | |
tree | e06122b62a9f97908ad6baf2608560278f7b58b4 /lib/libarchive | |
parent | 21be9a33552052acd03d5e25d1f2fc4adf3b72b7 (diff) | |
download | FreeBSD-src-6bd62572798c824be47137cb168d851cdf613bfc.zip FreeBSD-src-6bd62572798c824be47137cb168d851cdf613bfc.tar.gz |
O_BINARY for Windows.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_read_open_fd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libarchive/archive_read_open_fd.c b/lib/libarchive/archive_read_open_fd.c index 259ddc2..8a7829b 100644 --- a/lib/libarchive/archive_read_open_fd.c +++ b/lib/libarchive/archive_read_open_fd.c @@ -32,6 +32,12 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_ERRNO_H #include <errno.h> #endif +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif +#ifdef HAVE_IO_H +#include <io.h> +#endif #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif @@ -95,6 +101,9 @@ archive_read_open_fd(struct archive *a, int fd, size_t block_size) mine->can_skip = 1; } else mine->can_skip = 0; +#if defined(__CYGWIN__) || defined(_WIN32) + setmode(mine->fd, O_BINARY); +#endif return (archive_read_open2(a, mine, NULL, file_read, file_skip, file_close)); |