Set the close-on-exec flag on file descriptors
This commit is contained in:
		
							parent
							
								
									7b22bec252
								
							
						
					
					
						commit
						35355fc1fc
					
				
					 5 changed files with 20 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -20,6 +20,8 @@ int openLockFile(const Path & path, bool create)
 | 
			
		|||
    if (fd == -1 && (create || errno != ENOENT))
 | 
			
		||||
        throw SysError(format("opening lock file `%1%'") % path);
 | 
			
		||||
 | 
			
		||||
    closeOnExec(fd);
 | 
			
		||||
 | 
			
		||||
    return fd.borrow();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue