SHA256
1
0
forked from pool/libcap
libcap/0005-Clean-up-the-exit-status-to-match-other-binaries.patch
Dirk Mueller 2db9681bdf - add 0001-Improve-the-usage-and-diagnostic-message-for-setcap.patch
0002-No-longer-need-the-Go-build-tag-allthreadssyscall.patch
  0003-Minor-fixes-for-cap-package-documentation.patch
  0004-checkpoint.patch
  0005-Clean-up-the-exit-status-to-match-other-binaries.patch
  0006-People-keep-emailing-me-about-the-license-for-libcap.patch
  0007-Augment-NOPRIV-libcap-mode-with-the-sticky-NO_NEW_PR.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/libcap?expand=0&rev=49
2021-01-04 19:31:04 +00:00

53 lines
1.2 KiB
Diff

From bdb10e77579c0a7d8a2d952a2cd938f50b02c9d0 Mon Sep 17 00:00:00 2001
From: "Andrew G. Morgan" <morgan@kernel.org>
Date: Sat, 26 Dec 2020 16:59:21 -0800
Subject: [PATCH 5/7] Clean up the exit status to match other binaries.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
---
progs/getcap.c | 10 +++++-----
1 file 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;
--
2.29.2