diff mbox series

[RFC,v2,19/27] libselinux: avoid unused function

Message ID 20230814132025.45364-20-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit 275daa4e0b33
Delegated to: Petr Lautrbach
Headers show
Series libselinux: rework selabel_file(5) database | expand

Commit Message

Christian Göttsche Aug. 14, 2023, 1:20 p.m. UTC
Define selabel_subs_init() only if its call-sites are enabled.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/src/label_file.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

James Carter Oct. 10, 2023, 7:15 p.m. UTC | #1
On Mon, Aug 14, 2023 at 9:41 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> Define selabel_subs_init() only if its call-sites are enabled.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

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

> ---
>  libselinux/src/label_file.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
> index f9f4648a..471fd56b 100644
> --- a/libselinux/src/label_file.c
> +++ b/libselinux/src/label_file.c
> @@ -674,6 +674,7 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src)
>         return NULL;
>  }
>
> +#if !defined(BUILD_HOST) && !defined(ANDROID)
>  static int selabel_subs_init(const char *path, struct selabel_digest *digest,
>                        struct selabel_sub **out_subs)
>  {
> @@ -756,6 +757,7 @@ err:
>         }
>         goto out;
>  }
> +#endif
>
>  static char *selabel_sub_key(struct saved_data *data, const char *key)
>  {
> --
> 2.40.1
>
James Carter Oct. 12, 2023, 5:55 p.m. UTC | #2
On Tue, Oct 10, 2023 at 3:15 PM James Carter <jwcart2@gmail.com> wrote:
>
> On Mon, Aug 14, 2023 at 9:41 AM Christian Göttsche
> <cgzones@googlemail.com> wrote:
> >
> > Define selabel_subs_init() only if its call-sites are enabled.
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> Acked-by: James Carter <jwcart2@gmail.com>
>
Merged.
Thanks,
Jim

> > ---
> >  libselinux/src/label_file.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
> > index f9f4648a..471fd56b 100644
> > --- a/libselinux/src/label_file.c
> > +++ b/libselinux/src/label_file.c
> > @@ -674,6 +674,7 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src)
> >         return NULL;
> >  }
> >
> > +#if !defined(BUILD_HOST) && !defined(ANDROID)
> >  static int selabel_subs_init(const char *path, struct selabel_digest *digest,
> >                        struct selabel_sub **out_subs)
> >  {
> > @@ -756,6 +757,7 @@ err:
> >         }
> >         goto out;
> >  }
> > +#endif
> >
> >  static char *selabel_sub_key(struct saved_data *data, const char *key)
> >  {
> > --
> > 2.40.1
> >
diff mbox series

Patch

diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index f9f4648a..471fd56b 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -674,6 +674,7 @@  static char *selabel_sub(struct selabel_sub *ptr, const char *src)
 	return NULL;
 }
 
+#if !defined(BUILD_HOST) && !defined(ANDROID)
 static int selabel_subs_init(const char *path, struct selabel_digest *digest,
 		       struct selabel_sub **out_subs)
 {
@@ -756,6 +757,7 @@  err:
 	}
 	goto out;
 }
+#endif
 
 static char *selabel_sub_key(struct saved_data *data, const char *key)
 {