[libglnx] fdio: Include libgen.h again for dirname()
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libglnx] fdio: Include libgen.h again for dirname()
- Date: Tue, 12 Dec 2017 20:07:24 +0000 (UTC)
commit 31ef1961ec6ee57db910911b3af13698535ac7b3
Author: Colin Walters <walters verbum org>
Date: Tue Dec 12 14:14:53 2017 -0500
fdio: Include libgen.h again for dirname()
rpm-ostree at least uses `dirname()` and relied on the `#include <libgen.h>`
that we had previously.
glnx-fdio.h | 6 +++---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]