diff options
Diffstat (limited to 'win32/mingw.c')
-rw-r--r-- | win32/mingw.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 5cfba22f7..74cf56934 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -534,6 +534,11 @@ int mingw_fstat(int fd, struct mingw_stat *buf) | |||
534 | buf->st_mtime = buf64.st_mtime; | 534 | buf->st_mtime = buf64.st_mtime; |
535 | buf->st_ctime = buf64.st_ctime; | 535 | buf->st_ctime = buf64.st_ctime; |
536 | buf->st_blocks = ((buf64.st_size+4095)>>12)<<3; | 536 | buf->st_blocks = ((buf64.st_size+4095)>>12)<<3; |
537 | #if ENABLE_FEATURE_EXTRA_FILE_DATA | ||
538 | buf->st_dev = 0; | ||
539 | buf->st_ino = 0; | ||
540 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : 1; | ||
541 | #endif | ||
537 | goto success; | 542 | goto success; |
538 | } | 543 | } |
539 | 544 | ||
@@ -545,13 +550,14 @@ int mingw_fstat(int fd, struct mingw_stat *buf) | |||
545 | buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime)); | 550 | buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime)); |
546 | buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime)); | 551 | buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime)); |
547 | buf->st_blocks = ((buf->st_size+4095)>>12)<<3; | 552 | buf->st_blocks = ((buf->st_size+4095)>>12)<<3; |
548 | success: | ||
549 | #if ENABLE_FEATURE_EXTRA_FILE_DATA | 553 | #if ENABLE_FEATURE_EXTRA_FILE_DATA |
550 | buf->st_dev = fdata.dwVolumeSerialNumber; | 554 | buf->st_dev = fdata.dwVolumeSerialNumber; |
551 | buf->st_ino = fdata.nFileIndexLow | | 555 | buf->st_ino = fdata.nFileIndexLow | |
552 | (((uint64_t)fdata.nFileIndexHigh)<<32); | 556 | (((uint64_t)fdata.nFileIndexHigh)<<32); |
553 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : fdata.nNumberOfLinks; | 557 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : fdata.nNumberOfLinks; |
554 | #else | 558 | #endif |
559 | success: | ||
560 | #if !ENABLE_FEATURE_EXTRA_FILE_DATA | ||
555 | buf->st_dev = 0; | 561 | buf->st_dev = 0; |
556 | buf->st_ino = 0; | 562 | buf->st_ino = 0; |
557 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : 1; | 563 | buf->st_nlink = S_ISDIR(buf->st_mode) ? 2 : 1; |