mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibIPC: Add File(Core::Stream::File& file, ...)
This commit is contained in:
parent
f0d2a8dd57
commit
fe2ab2bd8c
Notes:
sideshowbarker
2024-07-17 02:05:47 +09:00
Author: https://github.com/LucasChollet
Commit: fe2ab2bd8c
Pull-request: https://github.com/SerenityOS/serenity/pull/16553
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <LibCore/Stream.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace IPC {
|
||||
|
@ -39,6 +40,12 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
File(Core::Stream::File& file, Args... args)
|
||||
: File(file.leak_fd(Badge<File> {}), args...)
|
||||
{
|
||||
}
|
||||
|
||||
File(File&& other)
|
||||
: m_fd(exchange(other.m_fd, -1))
|
||||
, m_close_on_destruction(exchange(other.m_close_on_destruction, false))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue