mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-22 10:36:55 -04:00
Remove IPC socket before creation (#1852)
(to make sure that socket path can be created)
This commit is contained in:
@@ -44,7 +44,9 @@ public interface IpcCommunicator extends Closeable {
|
||||
}
|
||||
// Didn't get any connection yet? I.e. we're the first app instance, so let's launch a server:
|
||||
try {
|
||||
return Server.create(socketPaths.iterator().next());
|
||||
final var socketPath = socketPaths.iterator().next();
|
||||
Files.deleteIfExists(socketPath); // ensure path does not exist before creating it
|
||||
return Server.create(socketPath);
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Failed to create IPC server", e);
|
||||
return new LoopbackCommunicator();
|
||||
|
||||
Reference in New Issue
Block a user