diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-12-28 10:57:04 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-12-28 10:57:04 +0100 |
commit | 43a3231b03aa0a639bcd8d61784c84095edfdb6e (patch) | |
tree | 3e722461be65504e6658f75b7b651f93bb8764e1 /src/tools/irm/irm.c | |
parent | bd99555a130400cfec1cbdcf5e4eaa08f133d041 (diff) | |
parent | f8e230049143412ac424d4cbfd4ca95b6c7f64e1 (diff) | |
download | ouroboros-43a3231b03aa0a639bcd8d61784c84095edfdb6e.tar.gz ouroboros-43a3231b03aa0a639bcd8d61784c84095edfdb6e.zip |
Merged in dstaesse/ouroboros/be-qoscube (pull request #329)
Some fixes
Diffstat (limited to 'src/tools/irm/irm.c')
-rw-r--r-- | src/tools/irm/irm.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/tools/irm/irm.c b/src/tools/irm/irm.c index 7b2f3331..ce92d3d5 100644 --- a/src/tools/irm/irm.c +++ b/src/tools/irm/irm.c @@ -20,12 +20,15 @@ */ #include <ouroboros/irm.h> -#include <stdio.h> -#include <string.h> +#include <ouroboros/errno.h> #include "irm_ops.h" #include "irm_utils.h" +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + static void usage(void) { printf("Usage: irm [OPERATION]\n\n" @@ -71,12 +74,23 @@ static int do_cmd(const char * argv0, return -1; } -int main(int argc, char ** argv) { +int main(int argc, char ** argv) +{ + int ret = 0; if (argc < 2) { usage(); return -1; } - return do_cmd(argv[1], argc - 1, argv + 1); + ret = do_cmd(argv[1], argc - 1, argv + 1); + + if (ret == -EIRMD) + printf("Failed to communicate with the " + "Ouroboros IPC Resource Manager daemon.\n"); + + if (ret) + exit(EXIT_FAILURE); + + exit(EXIT_SUCCESS); } |