summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2017-11-10 14:10:09 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2017-11-10 15:20:38 +0100
commit967e8301f735bd74d569c54ed9f547b8dfa8d115 (patch)
tree2601776c31b3417c10ddc46fb969d057064d047a
parent470c33a44d58e65a28979e016b1a4fc692da0503 (diff)
downloadouroboros-967e8301f735bd74d569c54ed9f547b8dfa8d115.tar.gz
ouroboros-967e8301f735bd74d569c54ed9f547b8dfa8d115.zip
lib: Use correct names for st_modes in RIB
The RIB implementation was using internal variables from the linux implementation instead of the POSIX defined macros. The POSIX defined macros require defining __USE_XOPEN to access them. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
-rw-r--r--src/lib/rib.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c
index dc78696b..aadc4246 100644
--- a/src/lib/rib.c
+++ b/src/lib/rib.c
@@ -38,10 +38,12 @@
#ifdef HAVE_FUSE
#define _FILE_OFFSET_BITS 64
#define FUSE_USE_VERSION 26
-#include <fuse.h>
+#if defined (__linux__)
+#define __USE_XOPEN
+#elif defined (__FreeBSD__)
+#define __XSI_VISIBLE 500
#endif
-
-#ifdef HAVE_FUSE
+#include <fuse.h>
#ifndef CLOCK_REALTIME_COARSE
#define CLOCK_REALTIME_COARSE CLOCK_REALTIME
@@ -182,7 +184,7 @@ static int rib_getattr(const char * path,
memset(st, 0, sizeof(*st));
if (strcmp(path, RT) == 0) {
- st->st_mode = __S_IFDIR | 0755;
+ st->st_mode = S_IFDIR | 0755;
st->st_nlink = 2;
st->st_uid = getuid();
st->st_gid = getgid();
@@ -195,7 +197,7 @@ static int rib_getattr(const char * path,
list_for_each(p, &rib.reg_comps) {
struct reg_comp * rc = list_entry(p, struct reg_comp, next);
if (strcmp(path + 1, rc->path) == 0) {
- st->st_mode = __S_IFDIR | 0755;
+ st->st_mode = S_IFDIR | 0755;
st->st_nlink = 2;
break;
}
@@ -206,7 +208,7 @@ static int rib_getattr(const char * path,
if (st->st_mode == 0) {
char buf[4096];
st->st_nlink = 2;
- st->st_mode = __S_IFREG | 0755;
+ st->st_mode = S_IFREG | 0755;
st->st_size = rib_read(path, buf, 4096, 0, NULL);
}