diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-06-14 14:56:55 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-06-14 14:56:55 +0200 |
commit | 337ab9fe73b86306b72b9eaae3b7be759f7bbd36 (patch) | |
tree | d7b237631ef17df911ec4aef766aba085a63bd30 /src/tools/echo/echo.c | |
parent | 6019a5b1ee574c8cea485ce5ba68ff77a24b4786 (diff) | |
parent | 6271d09bdd17114c3095b7e819a7bcded14f26a5 (diff) | |
download | ouroboros-337ab9fe73b86306b72b9eaae3b7be759f7bbd36.tar.gz ouroboros-337ab9fe73b86306b72b9eaae3b7be759f7bbd36.zip |
Merge remote-tracking branch 'upstream/be' into be-llc
Diffstat (limited to 'src/tools/echo/echo.c')
-rw-r--r-- | src/tools/echo/echo.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/tools/echo/echo.c b/src/tools/echo/echo.c index 849c0ca8..4484dc71 100644 --- a/src/tools/echo/echo.c +++ b/src/tools/echo/echo.c @@ -23,7 +23,6 @@ #include <stdio.h> #include <string.h> -#define SERVER_AP_NAME "echo-server" #define BUF_SIZE 256 #include "echo_client.c" @@ -37,14 +36,22 @@ static void usage() " --help Display this help text and exit\n"); } -int main(int argc, char ** argv) { +int main(int argc, char ** argv) +{ + int ret = -1; + if (ap_init(argv[0])) { + printf("Failed to init AP.\n"); + return -1; + } argc--; argv++; while (argc > 0) { if (strcmp(*argv, "-l") == 0 || strcmp(*argv, "--listen") == 0) { - return server_main(); + ret = server_main(); + ap_fini(); + return ret; } else { usage(); return 0; @@ -53,5 +60,9 @@ int main(int argc, char ** argv) { argv++; } - return client_main(); + ret = client_main(); + + ap_fini(); + + return ret; } |