Skip to contentSkip to conversation

syscall/pivot_root01.c: Fix compile error

PATCH New Jinhui huang 2 participants 2 messages Apr 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscall/pivot_root01.c: Fix compile error

1)The 'MS_REC' and 'MS_PRIVATE' flag are not defined on some old distros,
so add them into 'include/lapi/mount.h' to fix it.
2)Enclose macro with complex values in parentheses.

---
 include/lapi/mount.h                                | 10 +++++++++-
 testcases/kernel/syscalls/pivot_root/pivot_root01.c |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)
include/lapi/mount.h +9 -1
index 74e85c7..6c41e45 100644
@@ -19,8 +19,16 @@
 #ifndef __MOUNT_H__
 #define __MOUNT_H__
 
+#ifndef MS_REC
+#define MS_REC 16384
+#endif
+
+#ifndef MS_PRIVATE
+#define MS_PRIVATE (1<<18)
+#endif
+
 #ifndef MS_STRICTATIME
-#define MS_STRICTATIME  1 << 24
+#define MS_STRICTATIME (1 << 24)
 #endif
 
 #ifndef MNT_DETACH
testcases/kernel/syscalls/pivot_root/pivot_root01.c +1 -0
index eed3704..2e8a7ff 100644
@@ -14,6 +14,7 @@
 #include <stdlib.h>
 
 #include "tst_test.h"
+#include "lapi/mount.h"
 
 #ifdef HAVE_UNSHARE
 
Signature · 1 line
1.8.3.1