mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +00:00
LibIPC: Add an expressive way to close an IPC::File after sending it
If you don't need a file descriptor after sending it to someone over IPC, construct it with IPC::File(fd, IPC::File::CloseAfterSending) and LibIPC will take care of it for you. :^)
This commit is contained in:
parent
7f2d8e8884
commit
f1f7bf567b
4 changed files with 3 additions and 7 deletions
|
@ -48,8 +48,10 @@ public:
|
|||
}
|
||||
|
||||
// Tagged constructor for fd's that should be closed on destruction unless take_fd() is called.
|
||||
// Note that the tags are the same, this is intentional to allow expressive invocation.
|
||||
enum Tag {
|
||||
ConstructWithReceivedFileDescriptor = 1,
|
||||
CloseAfterSending = 1,
|
||||
};
|
||||
File(int fd, Tag)
|
||||
: m_fd(fd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue