mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									1849cfdad9
								
							
						
					
					
						commit
						4540401167
					
				
					 1 changed files with 20 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -3342,8 +3342,11 @@ int pa_open_cloexec(const char *fn, int flags, mode_t mode) {
 | 
			
		|||
        return fd;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if ((fd = open(fn, flags, mode)) < 0)
 | 
			
		||||
        return fd;
 | 
			
		||||
    if ((fd = open(fn, flags, mode)) >= 0)
 | 
			
		||||
        goto finish;
 | 
			
		||||
 | 
			
		||||
    /* return error */
 | 
			
		||||
    return fd;
 | 
			
		||||
 | 
			
		||||
finish:
 | 
			
		||||
    /* Some implementations might simply ignore O_CLOEXEC if it is not
 | 
			
		||||
| 
						 | 
				
			
			@ -3364,8 +3367,11 @@ int pa_socket_cloexec(int domain, int type, int protocol) {
 | 
			
		|||
        return fd;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if ((fd = socket(domain, type, protocol)) < 0)
 | 
			
		||||
        return fd;
 | 
			
		||||
    if ((fd = socket(domain, type, protocol)) >= 0)
 | 
			
		||||
        goto finish;
 | 
			
		||||
 | 
			
		||||
    /* return error */
 | 
			
		||||
    return fd;
 | 
			
		||||
 | 
			
		||||
finish:
 | 
			
		||||
    /* Some implementations might simply ignore SOCK_CLOEXEC if it is
 | 
			
		||||
| 
						 | 
				
			
			@ -3387,8 +3393,11 @@ int pa_pipe_cloexec(int pipefd[2]) {
 | 
			
		|||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if ((r = pipe(pipefd)) < 0)
 | 
			
		||||
        return r;
 | 
			
		||||
    if ((r = pipe(pipefd)) >= 0)
 | 
			
		||||
        goto finish;
 | 
			
		||||
 | 
			
		||||
    /* return error */
 | 
			
		||||
    return r;
 | 
			
		||||
 | 
			
		||||
finish:
 | 
			
		||||
    pa_make_fd_cloexec(pipefd[0]);
 | 
			
		||||
| 
						 | 
				
			
			@ -3409,8 +3418,11 @@ int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
 | 
			
		|||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if ((fd = accept(sockfd, addr, addrlen)) < 0)
 | 
			
		||||
        return fd;
 | 
			
		||||
    if ((fd = accept(sockfd, addr, addrlen)) >= 0)
 | 
			
		||||
        goto finish;
 | 
			
		||||
 | 
			
		||||
    /* return error */
 | 
			
		||||
    return fd;
 | 
			
		||||
 | 
			
		||||
finish:
 | 
			
		||||
    pa_make_fd_cloexec(fd);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue