diff mbox series

[v4,20/30] selftests/landlock: Fix error message

Message ID 20250108154338.1129069-21-mic@digikod.net (mailing list archive)
State Handled Elsewhere
Delegated to: Paul Moore
Headers show
Series Landlock audit support | expand

Commit Message

Mickaël Salaün Jan. 8, 2025, 3:43 p.m. UTC
The global variable errno may not be set in test_execute().  Do not use
it in related error message.

Cc: Günther Noack <gnoack@google.com>
Fixes: e1199815b47b ("selftests/landlock: Add user space tests")
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Link: https://lore.kernel.org/r/20250108154338.1129069-21-mic@digikod.net
---

Changes since v3:
- New patch.
---
 tools/testing/selftests/landlock/fs_test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mickaël Salaün Jan. 10, 2025, 11:24 a.m. UTC | #1
On Wed, Jan 08, 2025 at 04:43:28PM +0100, Mickaël Salaün wrote:
> The global variable errno may not be set in test_execute().  Do not use
> it in related error message.
> 
> Cc: Günther Noack <gnoack@google.com>
> Fixes: e1199815b47b ("selftests/landlock: Add user space tests")
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Link: https://lore.kernel.org/r/20250108154338.1129069-21-mic@digikod.net

Pushed in my next tree to simplify next patch series.

> ---
> 
> Changes since v3:
> - New patch.
> ---
>  tools/testing/selftests/landlock/fs_test.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c
> index 42ce1e79ba82..a359c0d3107f 100644
> --- a/tools/testing/selftests/landlock/fs_test.c
> +++ b/tools/testing/selftests/landlock/fs_test.c
> @@ -2011,8 +2011,7 @@ static void test_execute(struct __test_metadata *const _metadata, const int err,
>  	ASSERT_EQ(1, WIFEXITED(status));
>  	ASSERT_EQ(err ? 2 : 0, WEXITSTATUS(status))
>  	{
> -		TH_LOG("Unexpected return code for \"%s\": %s", path,
> -		       strerror(errno));
> +		TH_LOG("Unexpected return code for \"%s\"", path);
>  	};
>  }
>  
> -- 
> 2.47.1
> 
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c
index 42ce1e79ba82..a359c0d3107f 100644
--- a/tools/testing/selftests/landlock/fs_test.c
+++ b/tools/testing/selftests/landlock/fs_test.c
@@ -2011,8 +2011,7 @@  static void test_execute(struct __test_metadata *const _metadata, const int err,
 	ASSERT_EQ(1, WIFEXITED(status));
 	ASSERT_EQ(err ? 2 : 0, WEXITSTATUS(status))
 	{
-		TH_LOG("Unexpected return code for \"%s\": %s", path,
-		       strerror(errno));
+		TH_LOG("Unexpected return code for \"%s\"", path);
 	};
 }