mirror of https://github.com/skeeto/enchive.git
Unlink socket before use (agent).
parent
ff6ac9c7ca
commit
6e8453894b
|
@ -165,6 +165,11 @@ agent_run(const u8 *key, const u8 *iv)
|
|||
close(1);
|
||||
|
||||
umask(~(S_IRUSR | S_IWUSR));
|
||||
|
||||
if (unlink(addr.sun_path))
|
||||
if (errno != ENOENT)
|
||||
fatal("failed to remove existing socket -- %s", strerror(errno));
|
||||
|
||||
if (bind(pfd.fd, (struct sockaddr *)&addr, sizeof(addr))) {
|
||||
if (errno != EADDRINUSE)
|
||||
warning("could not bind agent socket %s -- %s",
|
||||
|
|
Loading…
Reference in New Issue