[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrV1-ZmOp1DWowhiO+qYPvM1f7t9GpsLh8W81cgPR=ThRQ@mail.gmail.com>
Date: Thu, 27 Jul 2017 11:50:52 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Shuah Khan <shuahkh@....samsung.com>
Cc: Shuah Khan <shuah@...nel.org>, Andrew Lutomirski <luto@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] selftests: capabilities: convert error output to TAP13
ksft framework
On Wed, Jul 26, 2017 at 2:18 PM, Shuah Khan <shuahkh@....samsung.com> wrote:
> Convert errx() and err() usage to appropriate TAP13 ksft API.
>
> Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
> ---
> tools/testing/selftests/capabilities/test_execve.c | 105 ++++++++++++---------
> .../testing/selftests/capabilities/validate_cap.c | 9 +-
> 2 files changed, 65 insertions(+), 49 deletions(-)
>
> diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c
> index 7c38233292b0..cf6778441381 100644
> --- a/tools/testing/selftests/capabilities/test_execve.c
> +++ b/tools/testing/selftests/capabilities/test_execve.c
> @@ -1,7 +1,6 @@
> #define _GNU_SOURCE
>
> #include <cap-ng.h>
> -#include <err.h>
> #include <linux/capability.h>
> #include <stdbool.h>
> #include <string.h>
> @@ -39,29 +38,32 @@ static void vmaybe_write_file(bool enoent_ok, char *filename, char *fmt, va_list
> int buf_len;
>
> buf_len = vsnprintf(buf, sizeof(buf), fmt, ap);
> - if (buf_len < 0) {
> - err(1, "vsnprintf failed");
> - }
> - if (buf_len >= sizeof(buf)) {
> - errx(1, "vsnprintf output truncated");
> - }
> + if (buf_len < 0)
> + ksft_exit_fail_msg("vsnprintf failed - %s\n", strerror(errno));
Could this not be a hypothetical ksft_exit_fail_msg_err or similar?
Or a shorter name like ksft_fatal_err()?
Powered by blists - more mailing lists