diff options
author | Nathan Straz <nstraz@redhat.com> | 2009-03-27 10:26:01 -0400 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2009-03-27 10:26:01 -0400 |
commit | 1d77e4339f830da64bfcb801667f721d55f30096 (patch) | |
tree | f8292c1bfb6c9be0973522b2606c87742f3ce395 | |
parent | 1b52e677a1368f68e6c450a61235461c64f7e7bf (diff) | |
download | qarsh-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |