Skip to content

Commit

Permalink
Kernel: Rename LocalSocket::create_connected_pair() => try_*()
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Aug 28, 2021
1 parent 7f96288 commit 48a1a3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Kernel/Net/LocalSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ KResultOr<NonnullRefPtr<LocalSocket>> LocalSocket::try_create(int type)
return ENOMEM;
}

KResultOr<SocketPair> LocalSocket::create_connected_pair(int type)
KResultOr<SocketPair> LocalSocket::try_create_connected_pair(int type)
{
auto socket_or_error = LocalSocket::try_create(type);
if (socket_or_error.is_error())
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Net/LocalSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LocalSocket final : public Socket {

public:
static KResultOr<NonnullRefPtr<LocalSocket>> try_create(int type);
static KResultOr<SocketPair> create_connected_pair(int type);
static KResultOr<SocketPair> try_create_connected_pair(int type);
virtual ~LocalSocket() override;

KResult sendfd(const FileDescription& socket_description, FileDescription& passing_description);
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Syscalls/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ KResultOr<FlatPtr> Process::sys$socketpair(Userspace<const Syscall::SC_socketpai
if (params.protocol != 0 && params.protocol != PF_LOCAL)
return EINVAL;

auto result = LocalSocket::create_connected_pair(params.type & SOCK_TYPE_MASK);
auto result = LocalSocket::try_create_connected_pair(params.type & SOCK_TYPE_MASK);
if (result.is_error())
return result.error();
auto pair = result.value();
Expand Down

0 comments on commit 48a1a3c

Please sign in to comment.