mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +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/Noncopyable.h>
|
||||||
#include <AK/NonnullOwnPtr.h>
|
#include <AK/NonnullOwnPtr.h>
|
||||||
#include <AK/Stream.h>
|
#include <AK/Stream.h>
|
||||||
|
#include <LibCore/Forward.h>
|
||||||
#include <LibIPC/Forward.h>
|
#include <LibIPC/Forward.h>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -67,7 +68,8 @@ public:
|
||||||
virtual ErrorOr<size_t> seek(i64 offset, SeekMode) override;
|
virtual ErrorOr<size_t> seek(i64 offset, SeekMode) override;
|
||||||
virtual ErrorOr<void> truncate(size_t length) 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;
|
m_should_close_file_descriptor = ShouldCloseFileDescriptor::No;
|
||||||
return m_fd;
|
return m_fd;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue