Remove any pre-existing socket before binding

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-11-05 21:40:50 +01:00
parent a09f0bd8e0
commit fb498dba96
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ int mksock(const char *path)
strcpy(un.sun_path, path);
unlink(un.sun_path);
if (bind(fd, (struct sockaddr *)&un, sizeof(un))) {
errmsg ="bind";
goto fail_errno;