mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
LibCore: Allow MappedFile
to make File
leak its fd
This commit is contained in:
parent
0f4a8731fd
commit
3a95c8111d
1 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <AK/Noncopyable.h>
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <AK/Stream.h>
|
||||
#include <LibCore/Forward.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
|
||||
namespace Core {
|
||||
|
@ -67,7 +68,8 @@ public:
|
|||
virtual ErrorOr<size_t> seek(i64 offset, SeekMode) override;
|
||||
virtual ErrorOr<void> truncate(size_t length) override;
|
||||
|
||||
int leak_fd(Badge<::IPC::File>)
|
||||
template<OneOf<::IPC::File, ::Core::MappedFile> VIP>
|
||||
int leak_fd(Badge<VIP>)
|
||||
{
|
||||
m_should_close_file_descriptor = ShouldCloseFileDescriptor::No;
|
||||
return m_fd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue