Don't leak a file descriptor in commonChildInit()
This commit is contained in:
		
							parent
							
								
									1d487dc6a6
								
							
						
					
					
						commit
						7b22bec252
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -367,6 +367,7 @@ void commonChildInit(Pipe & logPipe)
 | 
				
			||||||
        throw SysError(format("cannot open `%1%'") % pathNullDevice);
 | 
					        throw SysError(format("cannot open `%1%'") % pathNullDevice);
 | 
				
			||||||
    if (dup2(fdDevNull, STDIN_FILENO) == -1)
 | 
					    if (dup2(fdDevNull, STDIN_FILENO) == -1)
 | 
				
			||||||
        throw SysError("cannot dup null device into stdin");
 | 
					        throw SysError("cannot dup null device into stdin");
 | 
				
			||||||
 | 
					    close(fdDevNull);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue