diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-04-20 22:44:08 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-04-27 09:09:35 +0200 |
commit | 92f722017c084f1e13fb238e5c3ebfec78c0b70a (patch) | |
tree | 66442bbf80b3bf9a818978cfa34df1005637ca9c /lib | |
parent | 9869668884cb132e741a874894bdfe9762fb7c72 (diff) |
checksrc: exit error code if warnings or errors
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/checksrc.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index 2ec315bf4..c2b8d6583 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -5,11 +5,21 @@ my $file=$ARGV[0]; my $max_column = 79; my $indent = 2; +my $warnings; +my $errors; + sub checkwarn { my ($num, $col, $file, $line, $msg, $error) = @_; my $w=$error?"error":"warning"; + if($w) { + $warnings++; + } + else { + $errors++; + } + $col++; print "$file:$num:$col: $w: $msg\n"; print " $line\n"; @@ -116,3 +126,7 @@ if(!$copyright) { } close(R); + +if($errors || $warnings) { + exit 5; # return failure +} |