diff options
Diffstat (limited to 'common/sys')
-rw-r--r-- | common/sys/net.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/sys/net.c b/common/sys/net.c index df33392e..27f7975c 100644 --- a/common/sys/net.c +++ b/common/sys/net.c @@ -50,6 +50,9 @@ int tobind(const char * addr) servaddr.sun_family = AF_UNIX; strlcpy(servaddr.sun_path, addr, sizeof(servaddr.sun_path)); + // remove the file first if it exists. + unlink(servaddr.sun_path); + if (bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) { perror("bind()"); exit(1); |