cksum: Report exit status properly
This commit is contained in:
parent
e11717ab3b
commit
76ea3fdd52
4
cksum.c
4
cksum.c
@ -94,6 +94,7 @@ int
|
|||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
default:
|
default:
|
||||||
@ -106,6 +107,7 @@ main(int argc, char *argv[])
|
|||||||
for (; *argv; argc--, argv++) {
|
for (; *argv; argc--, argv++) {
|
||||||
if (!(fp = fopen(*argv, "r"))) {
|
if (!(fp = fopen(*argv, "r"))) {
|
||||||
weprintf("fopen %s:", *argv);
|
weprintf("fopen %s:", *argv);
|
||||||
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cksum(fp, *argv);
|
cksum(fp, *argv);
|
||||||
@ -113,5 +115,5 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user