mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	fix two thinkos in signal reset/close_all code
This commit is contained in:
		
							parent
							
								
									e3fb086681
								
							
						
					
					
						commit
						68ae1d4d00
					
				
					 1 changed files with 14 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1887,17 +1887,21 @@ int pa_close_allv(const int except_fds[]) {
 | 
			
		|||
    if (getrlimit(RLIMIT_NOFILE, &rl) < 0)
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
    for (fd = 0; fd < (int) rl.rlim_max; fd++) {
 | 
			
		||||
    for (fd = 3; fd < (int) rl.rlim_max; fd++) {
 | 
			
		||||
        int i;
 | 
			
		||||
        pa_bool_t found;
 | 
			
		||||
 | 
			
		||||
        if (fd <= 3)
 | 
			
		||||
        found = FALSE;
 | 
			
		||||
        for (i = 0; except_fds[i] >= 0; i++)
 | 
			
		||||
            if (except_fds[i] == fd) {
 | 
			
		||||
                found = TRUE;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        if (found)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        for (i = 0; except_fds[i] >= 0; i++)
 | 
			
		||||
            if (except_fds[i] == fd)
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
        if (close(fd) < 0 && errno != EBADF)
 | 
			
		||||
        if (pa_close(fd) < 0 && errno != EBADF)
 | 
			
		||||
            return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1972,10 +1976,11 @@ int pa_reset_sigs(int except, ...) {
 | 
			
		|||
 | 
			
		||||
    i = 0;
 | 
			
		||||
    if (except >= 1) {
 | 
			
		||||
        int sig;
 | 
			
		||||
        p[i++] = except;
 | 
			
		||||
 | 
			
		||||
        while ((p[i++] = va_arg(ap, int)) >= 0)
 | 
			
		||||
            ;
 | 
			
		||||
        while ((sig = va_arg(ap, int)) >= 0)
 | 
			
		||||
            sig = p[i++];
 | 
			
		||||
    }
 | 
			
		||||
    p[i] = -1;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue