From db5e9bf4f884097ec919aa40b02d8eafab05cfa8 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 25 Feb 2022 00:15:32 +0100 Subject: tools: Fix return value on error in ocbr The ocbr tool was returning 0 on error. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/tools/ocbr/ocbr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/ocbr/ocbr.c b/src/tools/ocbr/ocbr.c index 2643b588..1d52cc1a 100644 --- a/src/tools/ocbr/ocbr.c +++ b/src/tools/ocbr/ocbr.c @@ -155,17 +155,22 @@ int main(int argc, char ** argv) if (s_apn == NULL) { printf("No server specified.\n"); usage(); - return 0; + return 1; } if (size > BUF_SIZE) { printf("Maximum size: %ld.\n", BUF_SIZE); - return 0; + return 1; } if (size < 0) { printf("Size overflow.\n"); - return 0; + return 1; + } + + if (rate <= 0) { + printf("Invalid rate.\n"); + return 1; } ret = client_main(s_apn, duration, size, rate, flood, sleep); -- cgit v1.2.3