1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

Merge pull request #2819 from bachradsusi/mac_selinux_bind-do-not-rely-on-errno

socket_address_listen - do not rely on errno
This commit is contained in:
Daniel Mack 2016-03-10 13:31:59 +01:00
commit b5adc91a67

View File

@ -122,7 +122,7 @@ int socket_address_listen(
r = mac_selinux_bind(fd, &a->sockaddr.sa, a->size); r = mac_selinux_bind(fd, &a->sockaddr.sa, a->size);
if (r < 0 && errno == EADDRINUSE) { if (r == -EADDRINUSE) {
/* Unlink and try again */ /* Unlink and try again */
unlink(a->sockaddr.un.sun_path); unlink(a->sockaddr.un.sun_path);
r = bind(fd, &a->sockaddr.sa, a->size); r = bind(fd, &a->sockaddr.sa, a->size);