summaryrefslogtreecommitdiff
path: root/src/tools/oecho
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-05-01 15:30:40 +0200
committerSander Vrijders <sander@ouroboros.rocks>2026-05-20 08:17:04 +0200
commit3be3360349ee823531d6c3e53b188a7e8af2b761 (patch)
tree733730ec06017c753eabc1d552fe31fe2bbf24f3 /src/tools/oecho
parente05bd477e73b9a5d533c4865022602dc60cec1ab (diff)
downloadouroboros-3be3360349ee823531d6c3e53b188a7e8af2b761.tar.gz
ouroboros-3be3360349ee823531d6c3e53b188a7e8af2b761.zip
tools: Use distinct exit codes
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/tools/oecho')
-rw-r--r--src/tools/oecho/oecho.c8
1 files changed, 4 insertions, 4 deletions
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--;