Skip to content

Commit 7451f17

Browse files
committed
overlaycheck: Bail out on fatal errors
Fixes: #24 Signed-off-by: Phil Elwell <[email protected]>
1 parent 70c10db commit 7451f17

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

overlaycheck/overlaycheck

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ while (@ARGV && $ARGV[0] =~ /^-/)
5858
}
5959
else
6060
{
61-
error("Unknown option '$arg'");
61+
fatal_error("Unknown option '$arg'");
6262
}
6363
}
6464

@@ -76,7 +76,7 @@ while (@ARGV && $ARGV[0] =~ /^-/)
7676

7777
my $kerndir = `git rev-parse --show-toplevel 2>/dev/null`;
7878
chomp($kerndir);
79-
error("This isn't a Linux repository") if (!-d "$kerndir/kernel");
79+
fatal_error("This isn't a Linux repository") if (!-d "$kerndir/kernel");
8080

8181
chdir($kerndir."/arch/arm/boot/dts");
8282

@@ -699,3 +699,9 @@ sub error
699699
print("* $_[0]\n");
700700
$fail = 1;
701701
}
702+
703+
sub fatal_error
704+
{
705+
error(@_);
706+
exit(1);
707+
}

0 commit comments

Comments
 (0)