[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 3/5] lib/vfscore: fix conflicts with newlib



Consists of multiple tiny fixes:
  - syscalls.c: include dirent.h after unistd.h, because it requires
    off_t, ino_t and size_t declarations
  - vfs.h: kill unused OPEN_MAX definition
  - vnode.c: prefix S_BLKSIZE

Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
 lib/vfscore/syscalls.c | 3 +--
 lib/vfscore/vfs.h      | 2 --
 lib/vfscore/vnode.c    | 4 ++--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/vfscore/syscalls.c b/lib/vfscore/syscalls.c
index a2584ab1..1301f351 100644
--- a/lib/vfscore/syscalls.c
+++ b/lib/vfscore/syscalls.c
@@ -37,8 +37,6 @@
 
 #define _BSD_SOURCE
 #define _GNU_SOURCE
-#include <dirent.h>
-
 #include <limits.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -47,6 +45,7 @@
 #include <errno.h>
 #include <fcntl.h>
 
+#include <dirent.h>
 #include <vfscore/prex.h>
 #include <vfscore/vnode.h>
 #include <vfscore/file.h>
diff --git a/lib/vfscore/vfs.h b/lib/vfscore/vfs.h
index 81a61d75..bc17310a 100644
--- a/lib/vfscore/vfs.h
+++ b/lib/vfscore/vfs.h
@@ -64,8 +64,6 @@ extern int vfs_debug;
 
 #define ASSERT(e)      assert(e)
 
-#define OPEN_MAX       256
-
 /*
  * per task data
  */
diff --git a/lib/vfscore/vnode.c b/lib/vfscore/vnode.c
index d70746c9..b9008ac2 100644
--- a/lib/vfscore/vnode.c
+++ b/lib/vfscore/vnode.c
@@ -48,7 +48,7 @@
 #include <vfscore/vnode.h>
 #include "vfs.h"
 
-#define S_BLKSIZE 512
+#define __UK_S_BLKSIZE 512
 
 enum vtype iftovt_tab[16] = {
        VNON, VFIFO, VCHR, VNON, VDIR, VNON, VBLK, VNON,
@@ -353,7 +353,7 @@ vn_stat(struct vnode *vp, struct stat *st)
        st->st_mode = mode;
        st->st_nlink = vap->va_nlink;
        st->st_blksize = BSIZE;
-       st->st_blocks = vap->va_size / S_BLKSIZE;
+       st->st_blocks = vap->va_size / __UK_S_BLKSIZE;
        st->st_uid = vap->va_uid;
        st->st_gid = vap->va_gid;
        st->st_dev = vap->va_fsid;
-- 
2.19.2


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.