mirror of
https://github.com/pygos/usyslog.git
synced 2025-01-15 15:54:57 +01:00
Remove any pre-existing socket before binding
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
a09f0bd8e0
commit
fb498dba96
1 changed files with 2 additions and 0 deletions
2
mksock.c
2
mksock.c
|
@ -28,6 +28,8 @@ int mksock(const char *path)
|
||||||
|
|
||||||
strcpy(un.sun_path, path);
|
strcpy(un.sun_path, path);
|
||||||
|
|
||||||
|
unlink(un.sun_path);
|
||||||
|
|
||||||
if (bind(fd, (struct sockaddr *)&un, sizeof(un))) {
|
if (bind(fd, (struct sockaddr *)&un, sizeof(un))) {
|
||||||
errmsg ="bind";
|
errmsg ="bind";
|
||||||
goto fail_errno;
|
goto fail_errno;
|
||||||
|
|
Loading…
Reference in a new issue