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:
Michael Lotz 2009-03-14 16:06:49 +00:00
parent 04caac4ad1
commit e83cf52aa7

View File

@ -356,6 +356,9 @@ OverlayInode::Create(const char *name, int openMode, int perms, void **cookie,
status_t
OverlayInode::Open(int openMode, void **_cookie)
{
if (!fHasStat)
ReadStat(NULL);
if (fIsVirtual) {
if (openMode & O_TRUNC)
fStat.st_size = 0;