Change an eprintf to a die to stop child from running its own slideshow
The child thread was created because execlp will not return if successful. The eprintf was placed after the call to execlp to catch any error, but the child continued to return a (closed) fds[0], resulting in a second slideshow being run by the child. This commit fixes the issue by killing the child.
This commit is contained in:
		
				
					committed by
					
						 Markus Teich
						Markus Teich
					
				
			
			
				
	
			
			
			
						parent
						
							54daf38b08
						
					
				
				
					commit
					022ae48360
				
			
							
								
								
									
										2
									
								
								sent.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								sent.c
									
									
									
									
									
								
							| @ -153,7 +153,7 @@ filter(int fd, const char *cmd) | |||||||
| 		close(fds[0]); | 		close(fds[0]); | ||||||
| 		close(fds[1]); | 		close(fds[1]); | ||||||
| 		execlp("sh", "sh", "-c", cmd, (char *)0); | 		execlp("sh", "sh", "-c", cmd, (char *)0); | ||||||
| 		eprintf("execlp sh -c '%s':", cmd); | 		die("execlp sh -c '%s':", cmd); | ||||||
| 	} | 	} | ||||||
| 	close(fds[1]); | 	close(fds[1]); | ||||||
| 	return fds[0]; | 	return fds[0]; | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user