aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/capabilities/validate_cap.c
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2017-07-26 15:08:39 -0600
committerShuah Khan <shuahkh@osg.samsung.com>2017-08-14 11:31:15 -0600
commit3c1f619eea08cc31057c437a1c064e33c73ebe35 (patch)
tree92d9bb82ac974e4b8414be5c2a72bf6c0c4a647a /tools/testing/selftests/capabilities/validate_cap.c
parentselftests: memfd: Align STACK_SIZE for ARM AArch64 system (diff)
downloadlinux-dev-3c1f619eea08cc31057c437a1c064e33c73ebe35.tar.xz
linux-dev-3c1f619eea08cc31057c437a1c064e33c73ebe35.zip
selftests: capabilities: convert error output to TAP13 ksft framework
Convert errx() and err() usage to appropriate TAP13 ksft API. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/capabilities/validate_cap.c')
-rw-r--r--tools/testing/selftests/capabilities/validate_cap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c
index 9fd4345a8987..694cd73d4493 100644
--- a/tools/testing/selftests/capabilities/validate_cap.c
+++ b/tools/testing/selftests/capabilities/validate_cap.c
@@ -1,5 +1,4 @@
#include <cap-ng.h>
-#include <err.h>
#include <linux/capability.h>
#include <stdbool.h>
#include <string.h>
@@ -27,8 +26,10 @@ static bool bool_arg(char **argv, int i)
return false;
else if (!strcmp(argv[i], "1"))
return true;
- else
- errx(1, "wrong argv[%d]", i);
+ else {
+ ksft_exit_fail_msg("wrong argv[%d]\n", i);
+ return false;
+ }
}
int main(int argc, char **argv)
@@ -41,7 +42,7 @@ int main(int argc, char **argv)
*/
if (argc != 5)
- errx(1, "wrong argc");
+ ksft_exit_fail_msg("wrong argc\n");
#ifdef HAVE_GETAUXVAL
if (getauxval(AT_SECURE))