Patchwork Fix conditional compilation case CONFIG_INOTIFY && !CONFIG_INOTIFY1.

login
register
mail settings
Submitter takasi-y@ops.dti.ne.jp
Date March 28, 2010, 8:15 a.m.
Message ID <201003280815.o2S8FEvj022108@smtp12.dti.ne.jp>
Download mbox | patch
Permalink /patch/48771/
State New
Headers show

Comments

takasi-y@ops.dti.ne.jp - March 28, 2010, 8:15 a.m.
There is undefined reference to sys_inotify_init1() at do_syscall() when
CONFIG_INOTIFY=y and CONFIG_INOTIFY1=n.

We should undef TARGET_NR_inotify_init1 if CONFIG_INOTIFY1 is undefined, as
it seems to be the strategy of conditional compilation here.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
---
 linux-user/syscall.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9ea990d..5050e60 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -506,22 +506,24 @@  static int sys_inotify_rm_watch(int fd, int32_t wd)
   return (inotify_rm_watch(fd, wd));
 }
 #endif
-#ifdef CONFIG_INOTIFY1
-#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
-static int sys_inotify_init1(int flags)
-{
-  return (inotify_init1(flags));
-}
-#endif
-#endif
 #else
 /* Userspace can usually survive runtime without inotify */
 #undef TARGET_NR_inotify_init
-#undef TARGET_NR_inotify_init1
 #undef TARGET_NR_inotify_add_watch
 #undef TARGET_NR_inotify_rm_watch
 #endif /* CONFIG_INOTIFY  */
 
+#ifdef CONFIG_INOTIFY1
+#include <sys/inotify.h>
+#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
+static int sys_inotify_init1(int flags)
+{
+  return (inotify_init1(flags));
+}
+#endif
+#else
+#undef TARGET_NR_inotify_init1
+#endif /* CONFIG_INOTIFY1 */
 
 extern int personality(int);
 extern int flock(int, int);