From 1d77e4339f830da64bfcb801667f721d55f30096 Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Fri, 27 Mar 2009 10:26:01 -0400 Subject: [btimec] Fail if the host is down Make btimec return proper exit codes so it is more useful in scripts. --- btimec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/btimec.c b/btimec.c index 38f4fd6..f1d4518 100644 --- a/btimec.c +++ b/btimec.c @@ -38,6 +38,7 @@ main(int argc, char **argv) char *btimedhost; int readable = 0; int c; + int ret = 0; while ((c = getopt(argc, argv, "r")) != -1) { switch (c) { @@ -65,6 +66,7 @@ main(int argc, char **argv) } else { printf("%s: %u\n", btimedhost, bt); } + if (bt == 0) ret = 1; } - exit(0); + exit(ret); } -- cgit