Ensure that our stat buffer is available when opening. Otherwise reads could
fail and the O_TRUNC might be overwritten as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29520 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
04caac4ad1
commit
e83cf52aa7
@ -356,6 +356,9 @@ OverlayInode::Create(const char *name, int openMode, int perms, void **cookie,
|
|||||||
status_t
|
status_t
|
||||||
OverlayInode::Open(int openMode, void **_cookie)
|
OverlayInode::Open(int openMode, void **_cookie)
|
||||||
{
|
{
|
||||||
|
if (!fHasStat)
|
||||||
|
ReadStat(NULL);
|
||||||
|
|
||||||
if (fIsVirtual) {
|
if (fIsVirtual) {
|
||||||
if (openMode & O_TRUNC)
|
if (openMode & O_TRUNC)
|
||||||
fStat.st_size = 0;
|
fStat.st_size = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user