]> granicus.if.org Git - curl/commitdiff
checksrc: exit error code if warnings or errors
authorDaniel Stenberg <daniel@haxx.se>
Wed, 20 Apr 2011 20:44:08 +0000 (22:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 27 Apr 2011 07:09:35 +0000 (09:09 +0200)
lib/checksrc.pl

index 2ec315bf4c42264c63eda3f01a5376d42f1ea070..c2b8d6583c620037daf464f6ce0fb0c7aa76cc1f 100755 (executable)
@@ -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
+}