svn commit: r201084 - head/lib/libarchive

Tim Kientzle kientzle at FreeBSD.org
Mon Dec 28 02:14:09 UTC 2009


Author: kientzle
Date: Mon Dec 28 02:14:09 2009
New Revision: 201084
URL: http://svn.freebsd.org/changeset/base/201084

Log:
  Sync with googlecode some changes that have no impact on FreeBSD.

Modified:
  head/lib/libarchive/archive_read_disk_entry_from_file.c

Modified: head/lib/libarchive/archive_read_disk_entry_from_file.c
==============================================================================
--- head/lib/libarchive/archive_read_disk_entry_from_file.c	Mon Dec 28 02:09:57 2009	(r201083)
+++ head/lib/libarchive/archive_read_disk_entry_from_file.c	Mon Dec 28 02:14:09 2009	(r201084)
@@ -103,7 +103,7 @@ archive_read_disk_entry_from_file(struct
 	 * 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
 #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)


More information about the svn-src-head mailing list