diff options
author | 2011-04-30 16:45:22 +0000 | |
---|---|---|
committer | 2011-04-30 16:45:22 +0000 | |
commit | fe49637d3fa0d8f635baf4e5300b1e9119baa204 (patch) | |
tree | ee7f85600cb7248353cef48f1a76b373e76350c0 | |
parent | Use cons_decl() instead of rolling our own cn* prototypes (diff) | |
download | wireguard-openbsd-fe49637d3fa0d8f635baf4e5300b1e9119baa204.tar.xz wireguard-openbsd-fe49637d3fa0d8f635baf4e5300b1e9119baa204.zip |
return >0 when file is not found. (from FreeBSD)
ok miod@
-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 |