summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-08 04:52:21 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-08 04:52:21 +0200
commit65d6318c33ca6f3d6f26ab47c6144e5489d614bb (patch)
tree519b7660083cc2bee70b2449f485ee1a55dcff78 /Kernel/Process.cpp
parent7fcca0ce4b776637100f5dc1da8fda4e91668730 (diff)
downloadserenity-65d6318c33ca6f3d6f26ab47c6144e5489d614bb.zip
Kernel: Support non-blocking connect().
If connect() is called on a non-blocking socket, it will "fail" immediately with -EINPROGRESS. After that, you select() on the socket and wait for it to become writable.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index dca2c6ad85..9638f6399b 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -2038,7 +2038,7 @@ int Process::sys$connect(int sockfd, const sockaddr* address, socklen_t address_
return -EISCONN;
auto& socket = *descriptor->socket();
descriptor->set_socket_role(SocketRole::Connecting);
- auto result = socket.connect(address, address_size);
+ auto result = socket.connect(address, address_size, descriptor->is_blocking() ? ShouldBlock::Yes : ShouldBlock::No);
if (result.is_error()) {
descriptor->set_socket_role(SocketRole::None);
return result;