From patchwork Sun Mar 28 08:15:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix conditional compilation case CONFIG_INOTIFY && !CONFIG_INOTIFY1. Date: Sat, 27 Mar 2010 22:15:14 -0000 From: takasi-y@ops.dti.ne.jp X-Patchwork-Id: 48771 Message-Id: <201003280815.o2S8FEvj022108@smtp12.dti.ne.jp> To: qemu-devel@nongnu.org Cc: Riku Voipio 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 --- linux-user/syscall.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) 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 +#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);