diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-02-11 18:50:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-02-11 18:50:38 +0100 |
commit | eef46c372f64f40dd75415b2c504c73138719c8d (patch) | |
tree | d13d0d3b02025f837ccc360e2e6adc259d61ec9a /src/libsystemd/sd-bus/bus-kernel.c | |
parent | e89fe484df6b94fcd775b923327b54eaf0a116e2 (diff) |
tree-wide: whenever we include libgen.h, immediately undefine basename()
Also, document in adjacent comments and in CODING_STYLE why we do that.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 1714188ffd..b884074d95 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -25,10 +25,15 @@ #include <fcntl.h> #include <malloc.h> -#include <libgen.h> #include <sys/mman.h> #include <sys/prctl.h> +/* When we include libgen.h because we need dirname() we immediately + * undefine basename() since libgen.h defines it as a macro to the XDG + * version which is really broken. */ +#include <libgen.h> +#undef basename + #include "util.h" #include "strv.h" #include "memfd-util.h" |