[systemd-devel] [PATCH 3/3] core: remove unneeded <libgen.h> include

Lennart Poettering lennart at poettering.net
Wed Feb 11 09:52:32 PST 2015


On Wed, 11.02.15 18:27, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> > > extern char *__xpg_basename (char *__path) __THROW;
> > > #define basename	    __xpg_basename
> > > 
> > > And __xpg_basename is the borked implementation. #undef basename means that
> > > we use the GNU version instead.
> > 
> > So, hmm, so if I got this right:
> > 
> > a) The good basame() is in strings.h
> > b) The bad basename() is in libgen.h
> > c) The only other call in libgen.h is dirname()
> > 
> > Which means, that we only ever need to include libgen.h when we need
> > dirname(), and that avery single including of libgen.sh should be
> > matched with an "#undef basename"?
>
> Yes and yes.

OK, added one #undef basename now, and documented all this in adjacent
comments and in CODING_STYLE, since it's really not obvious...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list