Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2979076f authored by Mike Frysinger's avatar Mike Frysinger Committed by Michal Marek
Browse files

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: default avatarDiego Elio Pettenò <flameeyes@gentoo.org>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 43f901fb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;