summaryrefslogtreecommitdiff
path: root/src/tools/operf
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/operf
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/operf')
-rw-r--r--src/tools/operf/operf.c2
-rw-r--r--src/tools/operf/operf_client.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/operf/operf.c b/src/tools/operf/operf.c
index 1872b351..0198e871 100644
--- a/src/tools/operf/operf.c
+++ b/src/tools/operf/operf.c
@@ -248,5 +248,5 @@ int main(int argc, char ** argv)
if (ret < 0)
exit(EXIT_FAILURE);
- exit(EXIT_SUCCESS);
+ exit(ret);
}
diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c
index 7e8f1a9b..e478aeff 100644
--- a/src/tools/operf/operf_client.c
+++ b/src/tools/operf/operf_client.c
@@ -185,7 +185,7 @@ int client_main(void)
sigaction(SIGHUP, &sig_act, NULL) ||
sigaction(SIGPIPE, &sig_act, NULL)) {
printf("Failed to install sighandler.\n");
- return -1;
+ return 2;
}
client.sent = 0;
@@ -196,7 +196,7 @@ int client_main(void)
fd = flow_alloc(client.server_name, NULL, NULL);
if (fd < 0) {
printf("Failed to allocate flow.\n");
- return -1;
+ return 2;
}
if (client.conf.test_type == TEST_TYPE_BI)
@@ -207,7 +207,7 @@ int client_main(void)
if (flow_write(fd, &client.conf, sizeof(client.conf)) < 0) {
printf("Failed to send configuration.\n");
flow_dealloc(fd);
- return -1;
+ return 1;
}
sleep(1);