From 90e0de5f150e27573096036b3ec253128d821ae3 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 7 Feb 2024 14:59:34 +0100 Subject: fail when control socket already exists We don't wanna remove the control socket for a running nitro instance, this serves as an easy check to not have two running at the same time. --- nitro.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nitro.c b/nitro.c index 14587c9..74c769c 100644 --- a/nitro.c +++ b/nitro.c @@ -1002,12 +1002,11 @@ open_control_socket() { fatal("socket"); fcntl(controlsock, F_SETFD, FD_CLOEXEC); - unlink(path); mode_t mask = umask(0077); int r = bind(controlsock, (struct sockaddr *)&addr, sizeof addr); umask(mask); if (r < 0) - fatal("bind; errno=%d\n", errno); + fatal("could not bind control socket: errno=%d\n", errno); } void -- cgit 1.4.1