mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Kernel: Allow Socket subclasses to fail construction
For example, socket(AF_INET) should only succeed for valid SOCK_TYPEs.
This commit is contained in:
parent
a93f35ac71
commit
03d73cbaae
5 changed files with 7 additions and 6 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue