Remove duplicate code in ctl_bind()
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
1 parent
968cafe21b
commit
7e95f7a8ae
1 file changed
+1
-7
@@ -69,20 +69,14 @@ ctl_bind(int fd, const char *dir, const char *file)
|
|||||||
|
|
||||||
if (ctl_setsun(&sun, dir, name))
|
if (ctl_setsun(&sun, dir, name))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!bind(fd, (struct sockaddr *)&sun, sizeof(sun)))
|
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
if (ctl_setsun(&sun, dir, file))
|
if (ctl_setsun(&sun, dir, file))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
unlink(sun.sun_path);
|
unlink(sun.sun_path);
|
||||||
|
|
||||||
if (!bind(fd, (struct sockaddr *)&sun, sizeof(sun)))
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return bind(fd, (struct sockaddr *)&sun, sizeof(sun));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in new issue
Block a user