Commit dbfe4c3611a613df1f87b3d6a53063f7988ae5f7

Authored by aurel32
1 parent 0dc586b5

linux-user: fix problems with inotify syscalls

The sys_inotify* calls are defined if the target supports them and the
host supports the necessary syscalls.  But the syscalls are handled if
the target supports them.  This situation leads to compilation failures
when the host doesn't support the necessary syscalls, as the linker will
complain about undefined functions.

Fix this state of affairs by making the handling conditions the same as
the call definition conditions.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Acked-By: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7038 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 3 deletions
linux-user/syscall.c
@@ -6109,19 +6109,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, @@ -6109,19 +6109,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
6109 ret = do_futex(arg1, arg2, arg3, arg4, arg5, arg6); 6109 ret = do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
6110 break; 6110 break;
6111 #endif 6111 #endif
6112 -#ifdef TARGET_NR_inotify_init 6112 +#if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init)
6113 case TARGET_NR_inotify_init: 6113 case TARGET_NR_inotify_init:
6114 ret = get_errno(sys_inotify_init()); 6114 ret = get_errno(sys_inotify_init());
6115 break; 6115 break;
6116 #endif 6116 #endif
6117 -#ifdef TARGET_NR_inotify_add_watch 6117 +#if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)
6118 case TARGET_NR_inotify_add_watch: 6118 case TARGET_NR_inotify_add_watch:
6119 p = lock_user_string(arg2); 6119 p = lock_user_string(arg2);
6120 ret = get_errno(sys_inotify_add_watch(arg1, path(p), arg3)); 6120 ret = get_errno(sys_inotify_add_watch(arg1, path(p), arg3));
6121 unlock_user(p, arg2, 0); 6121 unlock_user(p, arg2, 0);
6122 break; 6122 break;
6123 #endif 6123 #endif
6124 -#ifdef TARGET_NR_inotify_rm_watch 6124 +#if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch)
6125 case TARGET_NR_inotify_rm_watch: 6125 case TARGET_NR_inotify_rm_watch:
6126 ret = get_errno(sys_inotify_rm_watch(arg1, arg2)); 6126 ret = get_errno(sys_inotify_rm_watch(arg1, arg2));
6127 break; 6127 break;