diff --git a/src/win/fs.c b/src/win/fs.c index d997b0ee..e5d878cf 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -861,9 +861,13 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { FileFsVolumeInformation); /* Buffer overflow (a warning status code) is expected here. */ - if (NT_ERROR(nt_status)) { + if (io_status.Status == STATUS_NOT_IMPLEMENTED) { + statbuf->st_dev = 0; + } else if (NT_ERROR(nt_status)) { SetLastError(pRtlNtStatusToDosError(nt_status)); return -1; + } else { + statbuf->st_dev = volume_info.VolumeSerialNumber; } /* Todo: st_mode should probably always be 0666 for everyone. We might also @@ -920,8 +924,6 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { statbuf->st_nlink = file_info.StandardInformation.NumberOfLinks; - statbuf->st_dev = volume_info.VolumeSerialNumber; - /* The st_blksize is supposed to be the 'optimal' number of bytes for reading * and writing to the disk. That is, for any definition of 'optimal' - it's * supposed to at least avoid read-update-write behavior when writing to the