summaryrefslogtreecommitdiff
path: root/scripts/headers_install.pl
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-11-23 19:54:02 -0500
committerMichal Marek <mmarek@suse.cz>2010-12-14 15:06:04 +0100
commit2979076fbf17a0947d6eba367b0cac19c907c160 (patch)
treea6491d3867e0b953453dee28ffca79da06deb0df /scripts/headers_install.pl
parent43f901fbc8ba94bfa8d58155ba9378d7a13af636 (diff)
downloadlinux-exynos-2979076fbf17a0947d6eba367b0cac19c907c160.tar.gz
linux-exynos-2979076fbf17a0947d6eba367b0cac19c907c160.tar.bz2
linux-exynos-2979076fbf17a0947d6eba367b0cac19c907c160.zip
headers_install: check exit status of unifdef
If unifdef fails for any reason (like segfaulting), we should be aborting the install steps. So check its exit status in this unlikely scenario. Reported-by: Diego Elio Pettenò <flameeyes@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/headers_install.pl')
-rw-r--r--scripts/headers_install.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 4ca3be3b2e50..efb3be10d428 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 > 1) {
+ die "$tmpfile: $!\n";
+ }
unlink $tmpfile;
}
exit 0;