aboutsummaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2020-12-26 16:59:21 -0800
committerAndrew G. Morgan <morgan@kernel.org>2020-12-26 16:59:21 -0800
commitbdb10e77579c0a7d8a2d952a2cd938f50b02c9d0 (patch)
tree0921b4ab8bb5b1cb7c6759b4dc9c60040006842c /progs
parent0799b36a415c081c35a6e8e0f2a6b739d574fbd5 (diff)
downloadlibcap-bdb10e77579c0a7d8a2d952a2cd938f50b02c9d0.tar.gz
Clean up the exit status to match other binaries.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'progs')
-rw-r--r--progs/getcap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/progs/getcap.c b/progs/getcap.c
index b4a9a60..e578bbd 100644
--- a/progs/getcap.c
+++ b/progs/getcap.c
@@ -23,14 +23,14 @@ static int verbose = 0;
static int recursive = 0;
static int namespace = 0;
-static void usage(int ok)
+static void usage(int code)
{
fprintf(stderr,
"usage: getcap [-v] [-r] [-h] [-n] <filename> [<filename> ...]\n"
"\n"
"\tdisplays the capabilities on the queried file(s).\n"
);
- exit(!ok);
+ exit(code);
}
static int do_getcap(const char *fname, const struct stat *stbuf,
@@ -94,14 +94,14 @@ int main(int argc, char **argv)
namespace = 1;
break;
case 'h':
- usage(1);
- default:
usage(0);
+ default:
+ usage(1);
}
}
if (!argv[optind])
- usage(0);
+ usage(1);
for (i=optind; argv[i] != NULL; i++) {
struct stat stbuf;