core-util: Avoid warnings when missing certain system calls

on systems lacking #defines HAVE_ACCEPT4, HAVE_PIPE2, SOCK_CLOEXEC

pulsecore/core-util.c: In function 'pa_open_cloexec':
pulsecore/core-util.c:3348:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_socket_cloexec':
pulsecore/core-util.c:3370:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_pipe_cloexec':
pulsecore/core-util.c:3393:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_accept_cloexec':
pulsecore/core-util.c:3415:1: warning: label 'finish' defined but not used [-Wunused-label]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2014-08-13 00:30:01 +02:00
parent 1849cfdad9
commit 4540401167

View file

@ -3342,7 +3342,10 @@ int pa_open_cloexec(const char *fn, int flags, mode_t mode) {
return fd; return fd;
#endif #endif
if ((fd = open(fn, flags, mode)) < 0) if ((fd = open(fn, flags, mode)) >= 0)
goto finish;
/* return error */
return fd; return fd;
finish: finish:
@ -3364,7 +3367,10 @@ int pa_socket_cloexec(int domain, int type, int protocol) {
return fd; return fd;
#endif #endif
if ((fd = socket(domain, type, protocol)) < 0) if ((fd = socket(domain, type, protocol)) >= 0)
goto finish;
/* return error */
return fd; return fd;
finish: finish:
@ -3387,7 +3393,10 @@ int pa_pipe_cloexec(int pipefd[2]) {
#endif #endif
if ((r = pipe(pipefd)) < 0) if ((r = pipe(pipefd)) >= 0)
goto finish;
/* return error */
return r; return r;
finish: finish:
@ -3409,7 +3418,10 @@ int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
#endif #endif
if ((fd = accept(sockfd, addr, addrlen)) < 0) if ((fd = accept(sockfd, addr, addrlen)) >= 0)
goto finish;
/* return error */
return fd; return fd;
finish: finish: