[hackers] [sbase] cksum: Report exit status properly || sin
commit 0ce8afa329b2c1c0f63cfad67a936d0956f8b515
Author: sin <sin_AT_2f30.org>
Date: Wed Mar 11 12:32:44 2015 +0000
cksum: Report exit status properly
diff --git a/cksum.c b/cksum.c
index 59a4f88..e931c6e 100644
--- a/cksum.c
+++ b/cksum.c
_AT_@ -94,6 +94,7 @@ int
main(int argc, char *argv[])
{
FILE *fp;
+ int ret = 0;
ARGBEGIN {
default:
_AT_@ -106,6 +107,7 @@ main(int argc, char *argv[])
for (; *argv; argc--, argv++) {
if (!(fp = fopen(*argv, "r"))) {
weprintf("fopen %s:", *argv);
+ ret = 1;
continue;
}
cksum(fp, *argv);
_AT_@ -113,5 +115,5 @@ main(int argc, char *argv[])
}
}
- return 0;
+ return ret;
}
Received on Wed Mar 11 2015 - 13:42:34 CET
This archive was generated by hypermail 2.3.0
: Wed Mar 11 2015 - 13:48:19 CET