Re: [libgpiod][PATCH 2/3] tools-common: fix build for Android

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 17, 2020 at 10:23 AM Gary Bisson
<gary.bisson@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> Sorry for the delay.
>
> On Mon, Aug 10, 2020 at 09:15:18PM +0200, Bartosz Golaszewski wrote:
> > On Mon, Jun 8, 2020 at 11:07 AM Gary Bisson
> > <gary.bisson@xxxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > program_invocation_name doesn't exist in Android, getprogname() should
> > > be used instead.
> > >
> > > Signed-off-by: Gary Bisson <gary.bisson@xxxxxxxxxxxxxxxxxxx>
> > > ---
> > > Hi,
> > >
> > > I couldn't an equivalent to program_invocation_short_name, so the
> > > program is now using program_invocation_name all the time, hope it's ok.
> > >
> > > Regards,
> > > Gary
> > > ---
> > >  tools/tools-common.c | 10 +++++++---
> > >  1 file changed, 7 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/tools/tools-common.c b/tools/tools-common.c
> > > index 12bde20..1d7fc2c 100644
> > > --- a/tools/tools-common.c
> > > +++ b/tools/tools-common.c
> > > @@ -21,7 +21,11 @@
> > >
> > >  const char *get_progname(void)
> > >  {
> > > +#if defined __ANDROID__
> >
> > I'd prefer to keep libgpiod Android-agnostic. Does prctl() exist in
> > Android? It too can be used for that.
>
> Yes I understand. prctl() can be used in Android so it would definitely
> be a better option.
>
> Regards,
> Gary

The name returned by prctl(PR_GET_NAME, ...) is equivalent to
program_invocation_short_name. That would mean ditching the full
executable path everywhere in messages. Alternatively we can just set
the full program name at the start of every tool. I'm fine with the
latter too as long as we don't stick these __ANDROID__ ifdefs in the
tree.

Bart



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux