summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glnx-fdio.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/glnx-fdio.h b/glnx-fdio.h
index 8af54ff..c0a7cc1 100644
--- a/glnx-fdio.h
+++ b/glnx-fdio.h
@@ -29,6 +29,8 @@
#include <string.h>
#include <stdio.h>
#include <sys/xattr.h>
+// For dirname(), and previously basename()
+#include <libgen.h>
#include <glnx-macros.h>
#include <glnx-errors.h>
@@ -41,9 +43,7 @@ G_BEGIN_DECLS
static inline
const char *glnx_basename (const char *path)
{
- gchar *base;
-
- base = strrchr (path, G_DIR_SEPARATOR);
+ gchar *base = strrchr (path, G_DIR_SEPARATOR);
if (base)
return base + 1;