From 5db191374186b555d22dbde10d587e26326bbca0 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 8 Oct 2018 13:58:10 -0700 Subject: [PATCH] fixed build failure --- linux-user/ioctls.h | 2 +- linux-user/syscall.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 7dea36d8ee..96c4dbfa2e 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -47,7 +47,7 @@ IOCTL(TIOCSETD, IOC_W, MK_PTR(TYPE_INT)) IOCTL(TIOCGPTN, IOC_R, MK_PTR(TYPE_INT)) IOCTL(TIOCSPTLCK, IOC_W, MK_PTR(TYPE_INT)) -#ifdef TIOCGPTPEER +#if defined TIOCGPTPEER && defined TARGET_TIOCGPTPEER IOCTL_SPECIAL(TIOCGPTPEER, 0, do_ioctl_tiocgptpeer, TYPE_INT) #endif IOCTL(FIOCLEX, 0, TYPE_NULL) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f594b1db84..1a02e93d61 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5787,7 +5787,7 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp, } #endif -#ifdef TIOCGPTPEER +#if defined TIOCGPTPEER && defined TARGET_TIOCGPTPEER static abi_long do_ioctl_tiocgptpeer(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, int cmd, abi_long arg) { @@ -13861,9 +13861,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, if (arg4) { if (copy_from_user_timeval(&tv[0], arg4) || copy_from_user_timeval(&tv[1], - arg4 + sizeof(struct target_timeval))) + arg4 + sizeof(struct target_timeval))) { unlock_user(p, arg3, 0); goto efault; + } tvp = tv; } else { tvp = NULL;