diff mbox series

libselinux: drop set but not used internal variable

Message ID 20221109201701.64203-1-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit cd5de9230db5
Headers show
Series libselinux: drop set but not used internal variable | expand

Commit Message

Christian Göttsche Nov. 9, 2022, 8:17 p.m. UTC
The internal variable avc_netlink_trouble is only assigned but never
read from.
Unused since the initial commit 13cd4c896068 ("initial import from svn
trunk revision 2950").

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/src/avc_internal.c | 2 --
 libselinux/src/avc_internal.h | 3 ---
 libselinux/src/sestatus.c     | 1 -
 3 files changed, 6 deletions(-)

Comments

James Carter Nov. 10, 2022, 2:17 p.m. UTC | #1
On Wed, Nov 9, 2022 at 3:24 PM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> The internal variable avc_netlink_trouble is only assigned but never
> read from.
> Unused since the initial commit 13cd4c896068 ("initial import from svn
> trunk revision 2950").
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

Acked-by: James Carter <jwcart2@gmail.com>

> ---
>  libselinux/src/avc_internal.c | 2 --
>  libselinux/src/avc_internal.h | 3 ---
>  libselinux/src/sestatus.c     | 1 -
>  3 files changed, 6 deletions(-)
>
> diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c
> index 71a1357b..ffc663e5 100644
> --- a/libselinux/src/avc_internal.c
> +++ b/libselinux/src/avc_internal.c
> @@ -51,7 +51,6 @@ char avc_prefix[AVC_PREFIX_SIZE] = "uavc";
>  int avc_running = 0;
>  int avc_enforcing = 1;
>  int avc_setenforce = 0;
> -int avc_netlink_trouble = 0;
>
>  /* process setenforce events for netlink and sestatus */
>  int avc_process_setenforce(int enforcing)
> @@ -295,7 +294,6 @@ void avc_netlink_loop(void)
>
>         close(fd);
>         fd = -1;
> -       avc_netlink_trouble = 1;
>         avc_log(SELINUX_ERROR,
>                 "%s:  netlink thread: errors encountered, terminating\n",
>                 avc_prefix);
> diff --git a/libselinux/src/avc_internal.h b/libselinux/src/avc_internal.h
> index a9a4aa0b..54f0ce28 100644
> --- a/libselinux/src/avc_internal.h
> +++ b/libselinux/src/avc_internal.h
> @@ -180,7 +180,4 @@ int avc_ss_set_auditdeny(security_id_t ssid, security_id_t tsid,
>                          security_class_t tclass, access_vector_t perms,
>                          uint32_t seqno, uint32_t enable) ;
>
> -/* netlink kernel message code */
> -extern int avc_netlink_trouble ;
> -
>  #endif                         /* _SELINUX_AVC_INTERNAL_H_ */
> diff --git a/libselinux/src/sestatus.c b/libselinux/src/sestatus.c
> index 89c1f621..fbe64301 100644
> --- a/libselinux/src/sestatus.c
> +++ b/libselinux/src/sestatus.c
> @@ -343,7 +343,6 @@ error:
>                 if (avc_using_threads)
>                 {
>                         fallback_netlink_thread = avc_create_thread(&avc_netlink_loop);
> -                       avc_netlink_trouble = 0;
>                 }
>
>                 fallback_sequence = 0;
> --
> 2.38.1
>
James Carter Nov. 21, 2022, 8:56 p.m. UTC | #2
On Thu, Nov 10, 2022 at 9:17 AM James Carter <jwcart2@gmail.com> wrote:
>
> On Wed, Nov 9, 2022 at 3:24 PM Christian Göttsche
> <cgzones@googlemail.com> wrote:
> >
> > The internal variable avc_netlink_trouble is only assigned but never
> > read from.
> > Unused since the initial commit 13cd4c896068 ("initial import from svn
> > trunk revision 2950").
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> Acked-by: James Carter <jwcart2@gmail.com>
>

Merged.
Thanks,
Jim

> > ---
> >  libselinux/src/avc_internal.c | 2 --
> >  libselinux/src/avc_internal.h | 3 ---
> >  libselinux/src/sestatus.c     | 1 -
> >  3 files changed, 6 deletions(-)
> >
> > diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c
> > index 71a1357b..ffc663e5 100644
> > --- a/libselinux/src/avc_internal.c
> > +++ b/libselinux/src/avc_internal.c
> > @@ -51,7 +51,6 @@ char avc_prefix[AVC_PREFIX_SIZE] = "uavc";
> >  int avc_running = 0;
> >  int avc_enforcing = 1;
> >  int avc_setenforce = 0;
> > -int avc_netlink_trouble = 0;
> >
> >  /* process setenforce events for netlink and sestatus */
> >  int avc_process_setenforce(int enforcing)
> > @@ -295,7 +294,6 @@ void avc_netlink_loop(void)
> >
> >         close(fd);
> >         fd = -1;
> > -       avc_netlink_trouble = 1;
> >         avc_log(SELINUX_ERROR,
> >                 "%s:  netlink thread: errors encountered, terminating\n",
> >                 avc_prefix);
> > diff --git a/libselinux/src/avc_internal.h b/libselinux/src/avc_internal.h
> > index a9a4aa0b..54f0ce28 100644
> > --- a/libselinux/src/avc_internal.h
> > +++ b/libselinux/src/avc_internal.h
> > @@ -180,7 +180,4 @@ int avc_ss_set_auditdeny(security_id_t ssid, security_id_t tsid,
> >                          security_class_t tclass, access_vector_t perms,
> >                          uint32_t seqno, uint32_t enable) ;
> >
> > -/* netlink kernel message code */
> > -extern int avc_netlink_trouble ;
> > -
> >  #endif                         /* _SELINUX_AVC_INTERNAL_H_ */
> > diff --git a/libselinux/src/sestatus.c b/libselinux/src/sestatus.c
> > index 89c1f621..fbe64301 100644
> > --- a/libselinux/src/sestatus.c
> > +++ b/libselinux/src/sestatus.c
> > @@ -343,7 +343,6 @@ error:
> >                 if (avc_using_threads)
> >                 {
> >                         fallback_netlink_thread = avc_create_thread(&avc_netlink_loop);
> > -                       avc_netlink_trouble = 0;
> >                 }
> >
> >                 fallback_sequence = 0;
> > --
> > 2.38.1
> >
diff mbox series

Patch

diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c
index 71a1357b..ffc663e5 100644
--- a/libselinux/src/avc_internal.c
+++ b/libselinux/src/avc_internal.c
@@ -51,7 +51,6 @@  char avc_prefix[AVC_PREFIX_SIZE] = "uavc";
 int avc_running = 0;
 int avc_enforcing = 1;
 int avc_setenforce = 0;
-int avc_netlink_trouble = 0;
 
 /* process setenforce events for netlink and sestatus */
 int avc_process_setenforce(int enforcing)
@@ -295,7 +294,6 @@  void avc_netlink_loop(void)
 
 	close(fd);
 	fd = -1;
-	avc_netlink_trouble = 1;
 	avc_log(SELINUX_ERROR,
 		"%s:  netlink thread: errors encountered, terminating\n",
 		avc_prefix);
diff --git a/libselinux/src/avc_internal.h b/libselinux/src/avc_internal.h
index a9a4aa0b..54f0ce28 100644
--- a/libselinux/src/avc_internal.h
+++ b/libselinux/src/avc_internal.h
@@ -180,7 +180,4 @@  int avc_ss_set_auditdeny(security_id_t ssid, security_id_t tsid,
 			 security_class_t tclass, access_vector_t perms,
 			 uint32_t seqno, uint32_t enable) ;
 
-/* netlink kernel message code */
-extern int avc_netlink_trouble ;
-
 #endif				/* _SELINUX_AVC_INTERNAL_H_ */
diff --git a/libselinux/src/sestatus.c b/libselinux/src/sestatus.c
index 89c1f621..fbe64301 100644
--- a/libselinux/src/sestatus.c
+++ b/libselinux/src/sestatus.c
@@ -343,7 +343,6 @@  error:
 		if (avc_using_threads)
 		{
 			fallback_netlink_thread = avc_create_thread(&avc_netlink_loop);
-			avc_netlink_trouble = 0;
 		}
 
 		fallback_sequence = 0;