Kernel: Allow Socket subclasses to fail construction

For example, socket(AF_INET) should only succeed for valid SOCK_TYPEs.
This commit is contained in:
Andreas Kling 2020-01-23 18:11:14 +01:00
commit 03d73cbaae
Notes: sideshowbarker 2024-07-19 09:51:59 +09:00
5 changed files with 7 additions and 6 deletions

View file

@ -50,7 +50,7 @@ void LocalSocket::for_each(Function<void(LocalSocket&)> callback)
callback(socket);
}
NonnullRefPtr<LocalSocket> LocalSocket::create(int type)
KResultOr<NonnullRefPtr<Socket>> LocalSocket::create(int type)
{
return adopt(*new LocalSocket(type));
}