tap: fix exit status when we have exactly 256 errors.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 27 Sep 2011 04:55:59 +0000 (14:25 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 27 Sep 2011 04:55:59 +0000 (14:25 +0930)
ccan/tap/tap.c

index 7c01e140d5c206c475957f439b47eb3462fff994..bf8a276c7926a3cad99618cce1eaafbaf9d61582 100644 (file)
@@ -418,8 +418,8 @@ todo_end(void)
        UNLOCK;
 }
 
-int
-exit_status(void)
+static int
+exit_status_(void)
 {
        int r;
 
@@ -446,3 +446,12 @@ exit_status(void)
 
        return r;
 }
+
+int
+exit_status(void)
+{
+       int r = exit_status_();
+       if (r > 255)
+               r = 255;
+       return r;
+}