Re: [PATCH v5 27/68] selftests/lsm: Drop define _GNU_SOURCE

From: Casey Schaufler
Date: Tue May 21 2024 - 21:58:25 EST


On 5/21/2024 5:57 PM, Edward Liaw wrote:
> _GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent
> redefinition warnings.
>
> Reviewed-by: John Hubbard <jhubbard@xxxxxxxxxx>
> Reviewed-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx>
> Signed-off-by: Edward Liaw <edliaw@xxxxxxxxxx>

Acked-by: Casey Schaufler <casey@xxxxxxxxxxxxxxxx>

> ---
> tools/testing/selftests/lsm/common.c | 2 --
> tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 --
> tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 --
> tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 --
> 4 files changed, 8 deletions(-)
>
> diff --git a/tools/testing/selftests/lsm/common.c b/tools/testing/selftests/lsm/common.c
> index 9ad258912646..1b18aac570f1 100644
> --- a/tools/testing/selftests/lsm/common.c
> +++ b/tools/testing/selftests/lsm/common.c
> @@ -4,8 +4,6 @@
> *
> * Copyright © 2023 Casey Schaufler <casey@xxxxxxxxxxxxxxxx>
> */
> -
> -#define _GNU_SOURCE
> #include <linux/lsm.h>
> #include <fcntl.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/lsm/lsm_get_self_attr_test.c b/tools/testing/selftests/lsm/lsm_get_self_attr_test.c
> index df215e4aa63f..7465bde3f922 100644
> --- a/tools/testing/selftests/lsm/lsm_get_self_attr_test.c
> +++ b/tools/testing/selftests/lsm/lsm_get_self_attr_test.c
> @@ -5,8 +5,6 @@
> *
> * Copyright © 2022 Casey Schaufler <casey@xxxxxxxxxxxxxxxx>
> */
> -
> -#define _GNU_SOURCE
> #include <linux/lsm.h>
> #include <fcntl.h>
> #include <string.h>
> diff --git a/tools/testing/selftests/lsm/lsm_list_modules_test.c b/tools/testing/selftests/lsm/lsm_list_modules_test.c
> index 06d24d4679a6..a6b44e25c21f 100644
> --- a/tools/testing/selftests/lsm/lsm_list_modules_test.c
> +++ b/tools/testing/selftests/lsm/lsm_list_modules_test.c
> @@ -5,8 +5,6 @@
> *
> * Copyright © 2022 Casey Schaufler <casey@xxxxxxxxxxxxxxxx>
> */
> -
> -#define _GNU_SOURCE
> #include <linux/lsm.h>
> #include <string.h>
> #include <stdio.h>
> diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> index 66dec47e3ca3..110c6a07e74c 100644
> --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c
> @@ -5,8 +5,6 @@
> *
> * Copyright © 2022 Casey Schaufler <casey@xxxxxxxxxxxxxxxx>
> */
> -
> -#define _GNU_SOURCE
> #include <linux/lsm.h>
> #include <string.h>
> #include <stdio.h>