Browse Source

Fixing warnings reported by -Wall (#258)

* Fixing warnings reported by -Wall
* Adding macros to detect whether EPOLL related macros are defined
Li Lei 7 years ago
parent
commit
627f2dafb8
2 changed files with 9 additions and 2 deletions
  1. 4 2
      LibOS/shim/src/ipc/shim_ipc_nsimpl.h
  2. 5 0
      LibOS/shim/src/sys/shim_epoll.c

+ 4 - 2
LibOS/shim/src/ipc/shim_ipc_nsimpl.h

@@ -31,8 +31,6 @@
 
 #include <errno.h>
 
-#warning "be sure before including this file"
-
 #if !defined(NS) || !defined(NS_CAP)
 # error "NS or NS_CAP is not defined"
 #endif
@@ -844,6 +842,9 @@ static int connect_ns (IDTYPE * vmid, struct shim_ipc_port ** portptr)
     return 0;
 }
 
+// Turn off this function as it is not used
+// Keep the code for future use
+#if 0
 static int disconnect_ns(struct shim_ipc_port * port)
 {
     lock(cur_process.lock);
@@ -855,6 +856,7 @@ static int disconnect_ns(struct shim_ipc_port * port)
     del_ipc_port(port, IPC_PORT_LDR);
     return 0;
 }
+#endif
 
 int CONCAT3(prepare, NS, leader) (void)
 {

+ 5 - 0
LibOS/shim/src/sys/shim_epoll.c

@@ -38,6 +38,9 @@
 
 #include <linux/eventpoll.h>
 
+/* Avoid duplicated definitions */
+#ifndef EPOLLIN
+
 #define EPOLLIN         0x001
 #define EPOLLPRI        0x002
 #define EPOLLOUT        0x004
@@ -49,6 +52,8 @@
 #define EPOLLHUP        0x010
 #define EPOLLRDHUP      0x2000
 
+#endif
+
 #define MAX_EPOLL_FDS       1024
 
 struct shim_mount epoll_builtin_fs;