diff --git a/glnx-fdio.h b/glnx-fdio.h index 688eeb25..19f938c7 100644 --- a/glnx-fdio.h +++ b/glnx-fdio.h @@ -26,9 +26,24 @@ #include #include #include +/* From systemd/src/shared/util.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 +#undef basename G_BEGIN_DECLS +/* Irritatingly, g_basename() which is what we want + * is deprecated. + */ +static inline +const char *glnx_basename (const char *path) +{ + return (basename) (path); +} + GBytes * glnx_fd_readall_bytes (int fd, GCancellable *cancellable,