Skip to content

Truly independent web browser

LibWebView: Use DupFd to pass descriptors to helpers

Zaggy1024dd9bef932b14
diff --git a/Libraries/LibWebView/Process.cpp b/Libraries/LibWebView/Process.cpp
index 4256ed749d7..99f94631a21 100644
--- a/Libraries/LibWebView/Process.cpp
+++ b/Libraries/LibWebView/Process.cpp
@@ -226,13 +226,8 @@ ErrorOr<Process::ProcessAndIPCTransport> Process::spawn_and_connect_to_process([
ArmedScopeGuard guard_fd_0 { [&] { MUST(Core::System::close(socket_fds[0])); } };
ArmedScopeGuard guard_fd_1 { [&] { MUST(Core::System::close(socket_fds[1])); } };
-# if defined(AK_OS_WINDOWS)
- // Note: Core::System::socketpair creates inheritable sockets on Windows.
- TRY(Core::System::set_close_on_exec(socket_fds[0], true));
-# else
// Only the helper's end reaches the helper, and only this helper.
spawn_options.file_actions.append(Core::FileAction::DupFd { .write_fd = socket_fds[1], .fd = socket_fds[1] });
-# endif
// NB: Only the helper gets to see this, if it has an environment of its own.
auto takeover_string = ByteString::formatted("{}:{}", options.name, socket_fds[1]);