mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	try to use send(,,MSG_NOSIGNAL) instead of write() wherever possible (which
will allow us to drop the SIGPIPE check). Cache the results of the last write()/send() to make sure that we do not issue more than necessary system calls. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1083 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									350a253dc5
								
							
						
					
					
						commit
						860be2e70b
					
				
					 17 changed files with 100 additions and 58 deletions
				
			
		| 
						 | 
				
			
			@ -56,7 +56,7 @@ static pid_t read_pid(const char *fn, int fd) {
 | 
			
		|||
 | 
			
		||||
    assert(fn && fd >= 0);
 | 
			
		||||
 | 
			
		||||
    if ((r = pa_loop_read(fd, t, sizeof(t)-1)) < 0) {
 | 
			
		||||
    if ((r = pa_loop_read(fd, t, sizeof(t)-1, NULL)) < 0) {
 | 
			
		||||
        pa_log_warn(__FILE__": WARNING: failed to read PID file '%s': %s",
 | 
			
		||||
            fn, pa_cstrerror(errno));
 | 
			
		||||
        return (pid_t) -1;
 | 
			
		||||
| 
						 | 
				
			
			@ -177,7 +177,7 @@ int pa_pid_file_create(void) {
 | 
			
		|||
    snprintf(t, sizeof(t), "%lu\n", (unsigned long) getpid());
 | 
			
		||||
    l = strlen(t);
 | 
			
		||||
    
 | 
			
		||||
    if (pa_loop_write(fd, t, l) != (ssize_t) l) {
 | 
			
		||||
    if (pa_loop_write(fd, t, l, NULL) != (ssize_t) l) {
 | 
			
		||||
        pa_log(__FILE__": failed to write PID file.");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue