diff --git a/Libraries/LibCore/File.h b/Libraries/LibCore/File.h index 23fc7626cb2..1dc00413926 100644 --- a/Libraries/LibCore/File.h +++ b/Libraries/LibCore/File.h @@ -7,13 +7,11 @@ #pragma once -#include #include #include #include #include #include -#include namespace Core { @@ -77,8 +75,7 @@ public: // See also Socket::set_blocking. ErrorOr set_blocking(bool enabled); - template VIP> - int leak_fd(Badge) + int leak_fd() { m_should_close_file_descriptor = ShouldCloseFileDescriptor::No; return m_fd; diff --git a/Libraries/LibCore/MappedFile.cpp b/Libraries/LibCore/MappedFile.cpp index c8d45a88f6a..9df56674e26 100644 --- a/Libraries/LibCore/MappedFile.cpp +++ b/Libraries/LibCore/MappedFile.cpp @@ -22,7 +22,7 @@ ErrorOr> MappedFile::map(StringView path, Mode mode) ErrorOr> MappedFile::map_from_file(NonnullOwnPtr stream, StringView path) { - return map_from_fd_and_close(stream->leak_fd(Badge {}), path); + return map_from_fd_and_close(stream->leak_fd(), path); } ErrorOr> MappedFile::map_from_fd_and_close(int fd, [[maybe_unused]] StringView path, Mode mode) diff --git a/Libraries/LibIPC/File.h b/Libraries/LibIPC/File.h index 5aa1001010e..c91eeb6a6c0 100644 --- a/Libraries/LibIPC/File.h +++ b/Libraries/LibIPC/File.h @@ -22,7 +22,7 @@ public: static File adopt_file(NonnullOwnPtr file) { - return File(file->leak_fd(Badge {})); + return File(file->leak_fd()); } static File adopt_fd(int fd)