Don't close file descriptors when we are duplicating them.
This commit is contained in:
		
							
								
								
									
										3
									
								
								hush.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								hush.c
									
									
									
									
									
								
							| @@ -1018,7 +1018,8 @@ static int setup_redirects(struct child_prog *prog, int squirrel[]) | ||||
| 				close(openfd); | ||||
| 			} else { | ||||
| 				dup2(openfd, redir->fd); | ||||
| 				close(openfd); | ||||
| 				if (redir->dup == -1) | ||||
| 					close (openfd); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -1018,7 +1018,8 @@ static int setup_redirects(struct child_prog *prog, int squirrel[]) | ||||
| 				close(openfd); | ||||
| 			} else { | ||||
| 				dup2(openfd, redir->fd); | ||||
| 				close(openfd); | ||||
| 				if (redir->dup == -1) | ||||
| 					close (openfd); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user