diff options
-rw-r--r-- | linux-user/syscall.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 81f52f7..dfc1301 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11742,7 +11742,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init) case TARGET_NR_inotify_init: ret = get_errno(sys_inotify_init()); - fd_trans_register(ret, &target_inotify_trans); + if (ret >= 0) { + fd_trans_register(ret, &target_inotify_trans); + } break; #endif #ifdef CONFIG_INOTIFY1 @@ -11750,7 +11752,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_inotify_init1: ret = get_errno(sys_inotify_init1(target_to_host_bitmask(arg1, fcntl_flags_tbl))); - fd_trans_register(ret, &target_inotify_trans); + if (ret >= 0) { + fd_trans_register(ret, &target_inotify_trans); + } break; #endif #endif @@ -11916,7 +11920,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #if defined(TARGET_NR_eventfd) case TARGET_NR_eventfd: ret = get_errno(eventfd(arg1, 0)); - fd_trans_register(ret, &target_eventfd_trans); + if (ret >= 0) { + fd_trans_register(ret, &target_eventfd_trans); + } break; #endif #if defined(TARGET_NR_eventfd2) @@ -11930,7 +11936,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, host_flags |= O_CLOEXEC; } ret = get_errno(eventfd(arg1, host_flags)); - fd_trans_register(ret, &target_eventfd_trans); + if (ret >= 0) { + fd_trans_register(ret, &target_eventfd_trans); + } break; } #endif |