version 1.121, 2017/12/08 02:13:02 |
version 1.122, 2017/12/08 02:14:33 |
|
|
} |
} |
if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) { |
if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) { |
saved_errno = errno; |
saved_errno = errno; |
close(sock); |
|
error("%s: cannot bind to path %s: %s", |
error("%s: cannot bind to path %s: %s", |
__func__, path, strerror(errno)); |
__func__, path, strerror(errno)); |
|
close(sock); |
errno = saved_errno; |
errno = saved_errno; |
return -1; |
return -1; |
} |
} |
if (listen(sock, backlog) < 0) { |
if (listen(sock, backlog) < 0) { |
saved_errno = errno; |
saved_errno = errno; |
close(sock); |
|
unlink(path); |
|
error("%s: cannot listen on path %s: %s", |
error("%s: cannot listen on path %s: %s", |
__func__, path, strerror(errno)); |
__func__, path, strerror(errno)); |
|
close(sock); |
|
unlink(path); |
errno = saved_errno; |
errno = saved_errno; |
return -1; |
return -1; |
} |
} |