mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
parent
e590c53a1d
commit
a316ca0e0d
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include <Kernel/FileSystem/TmpFS.h>
|
#include <Kernel/FileSystem/TmpFS.h>
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
#include <Kernel/Thread.h>
|
#include <Kernel/Thread.h>
|
||||||
|
#include <LibC/limits.h>
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
@ -297,6 +298,9 @@ KResult TmpFSInode::add_child(Inode& child, const StringView& name, mode_t)
|
||||||
ASSERT(is_directory());
|
ASSERT(is_directory());
|
||||||
ASSERT(child.fsid() == fsid());
|
ASSERT(child.fsid() == fsid());
|
||||||
|
|
||||||
|
if (name.length() > NAME_MAX)
|
||||||
|
return KResult(-ENAMETOOLONG);
|
||||||
|
|
||||||
m_children.set(name, { name, static_cast<TmpFSInode&>(child) });
|
m_children.set(name, { name, static_cast<TmpFSInode&>(child) });
|
||||||
did_add_child(child.identifier());
|
did_add_child(child.identifier());
|
||||||
return KSuccess;
|
return KSuccess;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue