diff options
author | lum <lum@cvs.openbsd.org> | 2011-04-30 16:45:23 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2011-04-30 16:45:23 +0000 |
commit | 4f19c99adc364bb2945b3b0573eb1f3268328150 (patch) | |
tree | e82732a790193ad225572151fc0b4fd118dc8185 /usr.bin | |
parent | 76de34806021c53eff0d74a2ca1b4860c7d9f8ee (diff) |
return >0 when file is not found. (from FreeBSD)
ok miod@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/asa/asa.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/asa/asa.c b/usr.bin/asa/asa.c index c0a0bb4c502..55d363e2d3e 100644 --- a/usr.bin/asa/asa.c +++ b/usr.bin/asa/asa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asa.c,v 1.9 2009/10/27 23:59:35 deraadt Exp $ */ +/* $OpenBSD: asa.c,v 1.10 2011/04/30 16:45:22 lum Exp $ */ /* $NetBSD: asa.c,v 1.10 1995/04/21 03:01:41 cgd Exp $ */ /* @@ -43,7 +43,7 @@ __dead void usage(void); int main(int argc, char *argv[]) { - int ch; + int ch, exval = 0; FILE *fp; while ((ch = getopt(argc, argv, "")) != -1) { @@ -62,13 +62,14 @@ main(int argc, char *argv[]) for (; *argv != NULL; argv++) { if ((fp = fopen(*argv, "r")) == NULL) { warn("%s", *argv); + exval = 1; continue; } asa(fp); fclose(fp); } - exit(0); + exit(exval); } void |