diff mbox

[v2] headers_install: check exit status of unifdef

Message ID 1290552096-28568-1-git-send-email-vapier@gentoo.org (mailing list archive)
State New, archived
Headers show

Commit Message

Mike Frysinger Nov. 23, 2010, 10:41 p.m. UTC
None
diff mbox

Patch

diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 4ca3be3..59ad768 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -45,6 +45,13 @@  foreach my $file (@files) {
 	close $in;
 
 	system $unifdef . " $tmpfile > $installdir/$file";
+	# unifdef will exit 0 on success, and will exit 1 when the
+	# file was processed successfully but no changes were made,
+	# so abort only when it's higher than that.
+	my $e = $? >> 8;
+	if ($e > 2) {
+		die "$tmpfile: $!\n";
+	}
 	unlink $tmpfile;
 }
 exit 0;