Re: [libgpiod,v2 1/2] tools: use getprogname() when available to remove dependency on glibc

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

 



Fri, Feb 24, 2023 at 07:12:34PM -0800, Benjamin Li kirjoitti:
> Platforms like Bionic libc don't have program_invocation_[short_]name,
> which is a GNU extension. Use getprogname() from stdlib.h, another
> widely agreed extension, when it's available.
> 
> It seemed a little heavyweight to add gnulib to this project's autotools
> set-up just for making one function portable, so I've just added the
> portabilty shim to tools-common.c for the moment.

...

>  	printf("%s (libgpiod) v%s\n",
> -	       program_invocation_short_name, gpiod_api_version());
> +	       getprogname(), gpiod_api_version());

Now this can be a single line.

  	printf("%s (libgpiod) v%s\n", getprogname(), gpiod_api_version());

-- 
With Best Regards,
Andy Shevchenko





[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