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

This commit is contained in:
Tim Kientzle 2009-12-28 02:14:09 +00:00
parent 96de948146
commit f1bfc23207
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201084

View File

@ -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)