1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

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

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);