mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Initialized statbuf->st_mode in _stat() and _fstati64().
svn path=/trunk/; revision=2332
This commit is contained in:
parent
1dafd03c3d
commit
dbf14d8c26
1 changed files with 7 additions and 0 deletions
|
@ -37,6 +37,10 @@ int _fstat(int fd, struct stat *statbuf)
|
||||||
|
|
||||||
statbuf->st_dev = fd;
|
statbuf->st_dev = fd;
|
||||||
statbuf->st_size = FileInformation.nFileSizeLow;
|
statbuf->st_size = FileInformation.nFileSizeLow;
|
||||||
|
statbuf->st_mode = S_IREAD;
|
||||||
|
if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) statbuf->st_mode |= S_IFDIR;
|
||||||
|
if (!(FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) statbuf->st_mode |= S_IWRITE;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,5 +67,8 @@ __int64 _fstati64 (int fd, struct _stati64* statbuf)
|
||||||
statbuf->st_dev = fd;
|
statbuf->st_dev = fd;
|
||||||
statbuf->st_size = (((__int64)FileInformation.nFileSizeHigh) << 32) +
|
statbuf->st_size = (((__int64)FileInformation.nFileSizeHigh) << 32) +
|
||||||
FileInformation.nFileSizeLow;
|
FileInformation.nFileSizeLow;
|
||||||
|
statbuf->st_mode = S_IREAD;
|
||||||
|
if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) statbuf->st_mode |= S_IFDIR;
|
||||||
|
if (!(FileInformation.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) statbuf->st_mode |= S_IWRITE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue