[systemd-devel] [PATCH 3/3] core: remove unneeded <libgen.h> include
Lennart Poettering
lennart at poettering.net
Wed Feb 11 09:05:13 PST 2015
On Mon, 09.02.15 21:41, Cristian RodrÃguez (crrodriguez at opensuse.org) wrote:
> execute.c only uses basename (the GNU version in <string.h>)
Is this right even?
This was added by Zbigniew in 2b6bf07dd23bb467099d213c97b3875c5e453491:
"Get rid of our reimplementation of basename
The only problem is that libgen.h #defines basename to point to
it's own broken implementation instead of the GNU one. This can be
fixed by #undefining basename."
So, what's this about?
Somehow, given how stupid basename is defined, I am tempted to
introduce a call for this again, that is not stupid, and works for all
cases without ambiguities.
Anyway, Zbigniew, could you comment on this, please?
> ---
> src/core/execute.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/src/core/execute.c b/src/core/execute.c
> index 874cdc7..7b071e8 100644
> --- a/src/core/execute.c
> +++ b/src/core/execute.c
> @@ -40,8 +40,6 @@
> #include <sys/poll.h>
> #include <glob.h>
> #include <sys/personality.h>
> -#include <libgen.h>
> -#undef basename
>
> #ifdef HAVE_PAM
> #include <security/pam_appl.h>
> --
> 2.2.2
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list