From bbdcac04b0636e9322f481a554a37194b2026063 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Mon, 16 Apr 2012 00:33:03 +0200 Subject: [PATCH] Fixed exit codes --- test/mbus_parse.c | 1 + test/mbus_parse_hex.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/mbus_parse.c b/test/mbus_parse.c index 4286d08..2dfc32d 100644 --- a/test/mbus_parse.c +++ b/test/mbus_parse.c @@ -52,6 +52,7 @@ main(int argc, char *argv[]) mbus_frame_data_parse(&reply, &frame_data); mbus_frame_print(&reply); printf("%s", mbus_frame_data_xml(&frame_data)); + return 0; } diff --git a/test/mbus_parse_hex.c b/test/mbus_parse_hex.c index f662276..ced5a19 100644 --- a/test/mbus_parse_hex.c +++ b/test/mbus_parse_hex.c @@ -32,13 +32,13 @@ main(int argc, char *argv[]) if (argc != 2) { fprintf(stderr, "%s binary-file\n", argv[0]); - return -1; + return 1; } if ((fd = open(argv[1], O_RDONLY, 0)) == -1) { fprintf(stderr, "%s: failed to open '%s'", argv[0], argv[1]); - return -1; + return 1; } bzero(raw_buff, sizeof(raw_buff)); @@ -70,12 +70,12 @@ main(int argc, char *argv[]) if (result < 0) { fprintf(stderr, "mbus_parse: %s\n", mbus_error_str()); - return -1; + return 1; } else if (result > 0) { fprintf(stderr, "mbus_parse: need %d more bytes\n", result); - return -1; + return 1; } result = mbus_frame_data_parse(&reply, &frame_data); @@ -90,6 +90,7 @@ main(int argc, char *argv[]) //mbus_frame_print(&reply); //mbus_frame_data_print(&frame_data); printf("%s", mbus_frame_data_xml(&frame_data)); + return 0; }