1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

ramfs now supports O_TRUNC.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-21 00:12:20 +01:00
parent 23fde42249
commit 0b90ab534f

View file

@ -263,7 +263,12 @@ namespace Sortix
if ( files )
{
size_t fileindex = files->Search(LookupFile, path);
if ( fileindex != SIZE_MAX ) { return files->Get(fileindex); }
if ( fileindex != SIZE_MAX )
{
DevRAMFSFile* file = files->Get(fileindex);
if ( flags & O_TRUNC ) { file->Resize(0); }
return file;
}
}
return CreateFile(path, flags, mode);