[Rpm-maint] [PATCH 3/5] Drop local implementation of xsetprogname/xgetprogname

Panu Matilainen pmatilai at redhat.com
Fri Mar 24 09:12:12 UTC 2017


On 03/23/2017 09:08 PM, Neal Gompa wrote:
> On Thu, Mar 23, 2017 at 2:22 PM, Gleb Fotengauer-Malinovskiy
> <glebfm at altlinux.org> wrote:
>> It can be dropped because this code was never actually enabled.
>> Actually, this implementation *surely* never ever compiled.
>>
>
> Are you sure of this? Because this is supposed to be wired up so RPM
> builds and runs correctly on BSDs and Mac OS X... If it's not, then
> that's a problem...

That's my hazy recollection of this too, but if you look at what it 
actually does...

#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 
|| defined(__DragonFly__) || defined(__APPLE__)
[...]
# include <stdlib.h> /* Make sure this header is included */
# define xsetprogname(pn) setprogname(pn)
# define xgetprogname(pn) getprogname(pn)
#elif defined(__GLIBC__) /* GNU LIBC ships with (const *char *) 
__progname */
# define xsetprogname(pn) /* No need to implement it in GNU LIBC. */
   extern const char *__progname;
# define xgetprogname(pn) __progname
#else /* Reimplement setprogname and getprogname */
# include "misc/rpmxprogname.h"
# define xsetprogname(pn) _rpmxsetprogname(pn)
# define xgetprogname() _rpmxgetprogname()
#endif

So Apple and BSD etc dont need any of this, they have native 
setprogname() and getprogname(), and glibc just does it a bit 
differently. The local implementation is for anything unknown, and 
clearly nobody has actually tried it on those other platforms.
Then again this hasn't even been in any released rpm version yet.

I also wonder why it's just not checking for setprogname() existence in 
configure and use that information instead of this "did we remember all 
BSD-based variants" game.

	- Panu -

	- Panu -


More information about the Rpm-maint mailing list