mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	client: minor modernizations
This commit is contained in:
		
							parent
							
								
									6ce7d208f0
								
							
						
					
					
						commit
						8343360da1
					
				
					 1 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -701,9 +701,8 @@ static int context_autospawn(pa_context *c) {
 | 
			
		|||
        /* Child */
 | 
			
		||||
 | 
			
		||||
        const char *state = NULL;
 | 
			
		||||
#define MAX_ARGS 64
 | 
			
		||||
        const char * argv[MAX_ARGS+1];
 | 
			
		||||
        int n;
 | 
			
		||||
        const char * argv[32];
 | 
			
		||||
        unsigned n = 0;
 | 
			
		||||
 | 
			
		||||
        if (c->spawn_api.atfork)
 | 
			
		||||
            c->spawn_api.atfork();
 | 
			
		||||
| 
						 | 
				
			
			@ -712,12 +711,10 @@ static int context_autospawn(pa_context *c) {
 | 
			
		|||
 | 
			
		||||
        /* Setup argv */
 | 
			
		||||
 | 
			
		||||
        n = 0;
 | 
			
		||||
 | 
			
		||||
        argv[n++] = c->conf->daemon_binary;
 | 
			
		||||
        argv[n++] = "--start";
 | 
			
		||||
 | 
			
		||||
        while (n < MAX_ARGS) {
 | 
			
		||||
        while (n < PA_ELEMENTSOF(argv)-1) {
 | 
			
		||||
            char *a;
 | 
			
		||||
 | 
			
		||||
            if (!(a = pa_split_spaces(c->conf->extra_arguments, &state)))
 | 
			
		||||
| 
						 | 
				
			
			@ -727,10 +724,10 @@ static int context_autospawn(pa_context *c) {
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        argv[n++] = NULL;
 | 
			
		||||
        pa_assert(n <= PA_ELEMENTSOF(argv));
 | 
			
		||||
 | 
			
		||||
        execv(argv[0], (char * const *) argv);
 | 
			
		||||
        _exit(1);
 | 
			
		||||
#undef MAX_ARGS
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Parent */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue