From 3be3360349ee823531d6c3e53b188a7e8af2b761 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 1 May 2026 15:30:40 +0200 Subject: tools: Use distinct exit codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tools will now use the following convention: 0 — success 1 — runtime/I/O failure or packet loss 2 — setup failure oping now uses a SIGALRM to exit on duration tests. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/tools/oecho/oecho.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tools/oecho/oecho.c') diff --git a/src/tools/oecho/oecho.c b/src/tools/oecho/oecho.c index 14caab53..ef0a168f 100644 --- a/src/tools/oecho/oecho.c +++ b/src/tools/oecho/oecho.c @@ -101,20 +101,20 @@ static int client_main(void) fd = flow_alloc("oecho", NULL, NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); - return -1; + return 2; } if (flow_write(fd, message, strlen(message) + 1) < 0) { printf("Failed to write packet.\n"); flow_dealloc(fd); - return -1; + return 1; } count = flow_read(fd, buf, BUF_SIZE); if (count < 0) { printf("Failed to read packet.\n"); flow_dealloc(fd); - return -1; + return 1; } printf("Server replied with %.*s\n", (int) count, buf); @@ -126,7 +126,7 @@ static int client_main(void) int main(int argc, char ** argv) { - int ret = -1; + int ret = 0; bool server = false; argc--; -- cgit v1.2.3