瀏覽代碼

Kernel: Use TRY() once more in LocalSocket::try_create_connected_pair()

Andreas Kling 3 年之前
父節點
當前提交
a2bf8244fe
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Kernel/Net/LocalSocket.cpp

+ 1 - 2
Kernel/Net/LocalSocket.cpp

@@ -53,8 +53,7 @@ KResultOr<SocketPair> LocalSocket::try_create_connected_pair(int type)
     auto socket = TRY(LocalSocket::try_create(type));
     auto socket = TRY(LocalSocket::try_create(type));
     auto description1 = TRY(FileDescription::try_create(*socket));
     auto description1 = TRY(FileDescription::try_create(*socket));
 
 
-    if (auto result = socket->try_set_path("[socketpair]"sv); result.is_error())
-        return result;
+    TRY(socket->try_set_path("[socketpair]"sv));
 
 
     socket->set_acceptor(Process::current());
     socket->set_acceptor(Process::current());
     socket->set_connected(true);
     socket->set_connected(true);