WebDriver: Unlink server socket before binding to it

Previously, the create_server function would fail with an "Address
already in use" error if a file that used for socket address is
already exists.
This commit is contained in:
Aliaksandr Kalenik 2023-03-23 17:33:29 +03:00 committed by Andreas Kling
parent b76d3f287f
commit 34224c42ef
Notes: sideshowbarker 2024-07-16 22:31:12 +09:00

View File

@ -57,6 +57,8 @@ ErrorOr<NonnullRefPtr<Core::LocalServer>> Session::create_server(NonnullRefPtr<S
{
dbgln("Listening for WebDriver connection on {}", *m_web_content_socket_path);
(void)Core::System::unlink(*m_web_content_socket_path);
auto server = TRY(Core::LocalServer::try_create());
server->listen(*m_web_content_socket_path);