diff options
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/SystemServer/Service.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Services/SystemServer/Service.cpp b/Userland/Services/SystemServer/Service.cpp index f2d1c2dde2..90d677af18 100644 --- a/Userland/Services/SystemServer/Service.cpp +++ b/Userland/Services/SystemServer/Service.cpp @@ -35,6 +35,10 @@ ErrorOr<void> Service::setup_socket(SocketDescriptor& socket) { VERIFY(socket.fd == -1); + // Note: The purpose of this syscall is to remove potential left-over of previous portal. + // The return value is discarded as sockets are not always there, and unlinking a non-existent path is considered as a failure. + (void)Core::System::unlink(socket.path); + TRY(Core::Directory::create(LexicalPath(socket.path).parent(), Core::Directory::CreateDirectories::Yes)); // Note: we use SOCK_CLOEXEC here to make sure we don't leak every socket to |