Do not swallow errors from GCC
Without this patch posubst always exits with 0. This is a problem when chaining commands.
This commit is contained in:
		
							
								
								
									
										17
									
								
								posubst.in
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								posubst.in
									
									
									
									
									
								
							| @@ -52,5 +52,22 @@ foreach my $src (@src) { | |||||||
| } | } | ||||||
|  |  | ||||||
| map {s/(.*\.c)$/.$1/} @ARGV; | map {s/(.*\.c)$/.$1/} @ARGV; | ||||||
|  | my $err = 0; | ||||||
| system @ARGV; | system @ARGV; | ||||||
|  | if ($? == -1) { | ||||||
|  | 	print "failed to execute: $!\n"; | ||||||
|  | 	$err = 125; | ||||||
|  | } | ||||||
|  | elsif ($? & 127) { | ||||||
|  | 	printf "child died with signal %d\n", ($? & 127); | ||||||
|  | 	$err = 125; | ||||||
|  | } | ||||||
|  | else { | ||||||
|  | 	$err = $? >> 8; | ||||||
|  | 	if ($err != 0) { | ||||||
|  | 		printf "child exited with value %d\n", $err; | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
| unlink @tmp; | unlink @tmp; | ||||||
|  | exit $err; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user