Close open files before calling builtin_exec(). I've tested this
and it fixes bug #1121. -Erik
This commit is contained in:
		
							
								
								
									
										1
									
								
								lash.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								lash.c
									
									
									
									
									
								
							@@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
 | 
			
		||||
	if (child->argv[1] == NULL)
 | 
			
		||||
		return EXIT_SUCCESS;   /* Really? */
 | 
			
		||||
	child->argv++;
 | 
			
		||||
	close_all();
 | 
			
		||||
	pseudo_exec(child);
 | 
			
		||||
	/* never returns */
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								sh.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								sh.c
									
									
									
									
									
								
							@@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
 | 
			
		||||
	if (child->argv[1] == NULL)
 | 
			
		||||
		return EXIT_SUCCESS;   /* Really? */
 | 
			
		||||
	child->argv++;
 | 
			
		||||
	close_all();
 | 
			
		||||
	pseudo_exec(child);
 | 
			
		||||
	/* never returns */
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
 | 
			
		||||
	if (child->argv[1] == NULL)
 | 
			
		||||
		return EXIT_SUCCESS;   /* Really? */
 | 
			
		||||
	child->argv++;
 | 
			
		||||
	close_all();
 | 
			
		||||
	pseudo_exec(child);
 | 
			
		||||
	/* never returns */
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user