[pulseaudio-commits] src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Mon Nov 3 02:05:48 PST 2014
src/pulsecore/socket-server.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
New commits:
commit 9b87baf58aaa259a1ecb0832aafb3294cfd4d6a3
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date: Mon Nov 3 11:23:25 2014 +0200
socket-server: Improve readability
diff --git a/src/pulsecore/socket-server.c b/src/pulsecore/socket-server.c
index ef77563..25a2f8a 100644
--- a/src/pulsecore/socket-server.c
+++ b/src/pulsecore/socket-server.c
@@ -260,15 +260,14 @@ pa_socket_server* pa_socket_server_new_ipv4(pa_mainloop_api *m, uint32_t address
if (errno == EADDRINUSE && fallback) {
sa.sin_port = 0;
- if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) >= 0)
- goto good;
+ if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
+ pa_log("bind(): %s", pa_cstrerror(errno));
+ goto fail;
+ }
+ } else {
+ pa_log("bind(): %s", pa_cstrerror(errno));
+ goto fail;
}
-
- pa_log("bind(): %s", pa_cstrerror(errno));
- goto fail;
-
- good:
- ;
}
if (listen(fd, 5) < 0) {
@@ -329,15 +328,14 @@ pa_socket_server* pa_socket_server_new_ipv6(pa_mainloop_api *m, const uint8_t ad
if (errno == EADDRINUSE && fallback) {
sa.sin6_port = 0;
- if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) >= 0)
- goto good;
+ if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
+ pa_log("bind(): %s", pa_cstrerror(errno));
+ goto fail;
+ }
+ } else {
+ pa_log("bind(): %s", pa_cstrerror(errno));
+ goto fail;
}
-
- pa_log("bind(): %s", pa_cstrerror(errno));
- goto fail;
-
- good:
- ;
}
if (listen(fd, 5) < 0) {
More information about the pulseaudio-commits
mailing list