Skip to content
Snippets Groups Projects
Commit 175502e5 authored by Colin Walters's avatar Colin Walters
Browse files

Add glnx_basename()

We have to wrap the glibc version to ensure we get the right version,
otherwise depending on the variance of includes we may end up crashing
if we get the POSIX version.
parent a11b2eb2
No related branches found
No related tags found
No related merge requests found
......@@ -26,9 +26,24 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <attr/xattr.h>
/* 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 <libgen.h>
#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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment