From f1bfc23207822a4270be9457cd0dd19821de229f Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Mon, 28 Dec 2009 02:14:09 +0000 Subject: [PATCH] Sync with googlecode some changes that have no impact on FreeBSD. --- lib/libarchive/archive_read_disk_entry_from_file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libarchive/archive_read_disk_entry_from_file.c b/lib/libarchive/archive_read_disk_entry_from_file.c index 8f90191352aa..a8337650eef3 100644 --- a/lib/libarchive/archive_read_disk_entry_from_file.c +++ b/lib/libarchive/archive_read_disk_entry_from_file.c @@ -103,7 +103,7 @@ archive_read_disk_entry_from_file(struct archive *_a, * open file descriptor which we can use in the subsequent lookups. */ if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) { if (fd < 0) - fd = open(pathname, O_RDONLY | O_NONBLOCK); + fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY); if (fd >= 0) { unsigned long stflags; int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); @@ -114,6 +114,11 @@ archive_read_disk_entry_from_file(struct archive *_a, #endif if (st == NULL) { + /* TODO: On Windows, use GetFileInfoByHandle() here. + * Using Windows stat() call is badly broken, but + * even the stat() wrapper has problems because + * 'struct stat' is broken on Windows. + */ #if HAVE_FSTAT if (fd >= 0) { if (fstat(fd, &s) != 0)