mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibCore+LibIPC: Remove badge on File::leak_fd
This removes a dependency on LibIPC from LibCore.
This commit is contained in:
parent
d06809dee6
commit
18f28f398b
|
|
@ -7,13 +7,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/BufferedStream.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <AK/Stream.h>
|
||||
#include <LibCore/Forward.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
|
|
@ -77,8 +75,7 @@ public:
|
|||
// See also Socket::set_blocking.
|
||||
ErrorOr<void> set_blocking(bool enabled);
|
||||
|
||||
template<OneOf<::IPC::File, ::Core::MappedFile> VIP>
|
||||
int leak_fd(Badge<VIP>)
|
||||
int leak_fd()
|
||||
{
|
||||
m_should_close_file_descriptor = ShouldCloseFileDescriptor::No;
|
||||
return m_fd;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ ErrorOr<NonnullOwnPtr<MappedFile>> MappedFile::map(StringView path, Mode mode)
|
|||
|
||||
ErrorOr<NonnullOwnPtr<MappedFile>> MappedFile::map_from_file(NonnullOwnPtr<Core::File> stream, StringView path)
|
||||
{
|
||||
return map_from_fd_and_close(stream->leak_fd(Badge<MappedFile> {}), path);
|
||||
return map_from_fd_and_close(stream->leak_fd(), path);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<MappedFile>> MappedFile::map_from_fd_and_close(int fd, [[maybe_unused]] StringView path, Mode mode)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
|
||||
static File adopt_file(NonnullOwnPtr<Core::File> file)
|
||||
{
|
||||
return File(file->leak_fd(Badge<File> {}));
|
||||
return File(file->leak_fd());
|
||||
}
|
||||
|
||||
static File adopt_fd(int fd)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user