Skip to content

Commit

Permalink
headers_install: check exit status of unifdef
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vapier authored and michal42 committed Dec 14, 2010
1 parent 43f901f commit 2979076
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/headers_install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
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;

0 comments on commit 2979076

Please sign in to comment.