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:
parent
23fde42249
commit
0b90ab534f
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue