diff options
author | Shuah Khan <shuahkh@osg.samsung.com> | 2017-07-26 15:08:39 -0600 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-08-14 11:31:15 -0600 |
commit | 3c1f619eea08cc31057c437a1c064e33c73ebe35 (patch) | |
tree | 92d9bb82ac974e4b8414be5c2a72bf6c0c4a647a /tools/testing/selftests/capabilities/validate_cap.c | |
parent | 0e64f1d7dd803cd95b646b53f638bfbd6d2d330b (diff) | |
download | linux-3c1f619eea08cc31057c437a1c064e33c73ebe35.tar.gz linux-3c1f619eea08cc31057c437a1c064e33c73ebe35.tar.bz2 linux-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.c | 9 |
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)) |