From 55a923f0e84ac5bf3d84e8f13ca4bfa0aa856c09 Mon Sep 17 00:00:00 2001 From: kientzle Date: Mon, 28 Dec 2009 02:14:09 +0000 Subject: 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 8f90191..a833765 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) -- cgit v1.1