Browse Source

tap: fix exit status when we have exactly 256 errors.

Rusty Russell 14 years ago
parent
commit
cbca021270
1 changed files with 11 additions and 2 deletions
  1. 11 2
      ccan/tap/tap.c

+ 11 - 2
ccan/tap/tap.c

@@ -418,8 +418,8 @@ todo_end(void)
 	UNLOCK;
 	UNLOCK;
 }
 }
 
 
-int
-exit_status(void)
+static int
+exit_status_(void)
 {
 {
 	int r;
 	int r;
 
 
@@ -446,3 +446,12 @@ exit_status(void)
 
 
 	return r;
 	return r;
 }
 }
+
+int
+exit_status(void)
+{
+	int r = exit_status_();
+	if (r > 255)
+		r = 255;
+	return r;
+}