commit b1acd6f00e076ee63e2748fc2a94dba90000e542
parent c079dc576b037821fd22427238afc209763d621c
Author: sin <sin@2f30.org>
Date: Tue, 5 Jun 2012 18:31:31 +0100
sscall: Ensure we have proper exit values
We should normally be using EXIT_SUCCESS/EXIT_FAILURE but
the err()/errx() macros don't currently use that so be consistent
and use 0/1 throughout.
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sscall.c b/sscall.c
@@ -214,7 +214,6 @@ usage(const char *s)
fprintf(stderr, " -d\tOverride default driver ID\n");
fprintf(stderr, " -v\tEnable verbose output\n");
fprintf(stderr, " -h\tThis help screen\n");
- exit(EXIT_SUCCESS);
}
static void
@@ -291,6 +290,7 @@ main(int argc, char *argv[])
switch (c) {
case 'h':
usage(prog);
+ exit(0);
break;
case 'b':
fbits = strtol(optarg, NULL, 10);
@@ -309,14 +309,16 @@ main(int argc, char *argv[])
break;
case '?':
default:
- exit(EXIT_FAILURE);
+ exit(1);
}
}
argc -= optind;
argv += optind;
- if (argc != 3)
+ if (argc != 3) {
usage(prog);
+ exit(1);
+ }
if (!fbits)
fbits = 16;