mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 09:02:44 +00:00
Sync with googlecode some changes that have no impact on FreeBSD.
This commit is contained in:
parent
96de948146
commit
f1bfc23207
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201084
@ -103,7 +103,7 @@ archive_read_disk_entry_from_file(struct archive *_a,
|
|||||||
* open file descriptor which we can use in the subsequent lookups. */
|
* open file descriptor which we can use in the subsequent lookups. */
|
||||||
if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
|
if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
fd = open(pathname, O_RDONLY | O_NONBLOCK);
|
fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
unsigned long stflags;
|
unsigned long stflags;
|
||||||
int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
|
int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
|
||||||
@ -114,6 +114,11 @@ archive_read_disk_entry_from_file(struct archive *_a,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (st == NULL) {
|
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 HAVE_FSTAT
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
if (fstat(fd, &s) != 0)
|
if (fstat(fd, &s) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user