summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2009-03-27 10:26:01 -0400
committerNathan Straz <nstraz@redhat.com>2009-03-27 10:26:01 -0400
commit1d77e4339f830da64bfcb801667f721d55f30096 (patch)
treef8292c1bfb6c9be0973522b2606c87742f3ce395
parent1b52e677a1368f68e6c450a61235461c64f7e7bf (diff)
downloadqarsh-1d77e4339f830da64bfcb801667f721d55f30096.tar.gz
qarsh-1d77e4339f830da64bfcb801667f721d55f30096.tar.xz
qarsh-1d77e4339f830da64bfcb801667f721d55f30096.zip
[btimec] Fail if the host is down
Make btimec return proper exit codes so it is more useful in scripts.
-rw-r--r--btimec.c4
1 files changed, 3 insertions, 1 deletions
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);
}