1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

Kernel: Add LocalSocket::try_for_each() for fallible iteration

This API will allow users to short circuit iteration and properly
propagate errors.
This commit is contained in:
Idan Horowitz 2022-02-24 20:05:10 +02:00 committed by Andreas Kling
parent 74ab8ccde0
commit 24be52b3f5
2 changed files with 10 additions and 0 deletions

View file

@ -30,6 +30,7 @@ public:
ErrorOr<NonnullRefPtr<OpenFileDescription>> recvfd(const OpenFileDescription& socket_description);
static void for_each(Function<void(const LocalSocket&)>);
static ErrorOr<void> try_for_each(Function<ErrorOr<void>(const LocalSocket&)>);
StringView socket_path() const;
ErrorOr<NonnullOwnPtr<KString>> pseudo_path(const OpenFileDescription& description) const override;