From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMwjs-000855-G8 for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:24:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMwjl-000817-My for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:24:35 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMwjl-00080n-Gh for qemu-devel@nongnu.org; Tue, 12 Jul 2016 08:24:29 -0400 From: Peter Maydell Date: Tue, 12 Jul 2016 13:02:14 +0100 Message-Id: <1468324939-12221-4-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1468324939-12221-1-git-send-email-peter.maydell@linaro.org> References: <1468324939-12221-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 3/8] linux-user: Fix incorrect use of host errno in do_ioctl_dm() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Paolo Bonzini do_ioctl_dm() should return target errno values, not host ones; correct an accidental use of a host errno in an error path. Signed-off-by: Peter Maydell --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b868fb9..37d26bb 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4505,7 +4505,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, guest_data = arg + host_dm->data_start; if ((guest_data - arg) < 0) { - ret = -EINVAL; + ret = -TARGET_EINVAL; goto out; } guest_data_size = host_dm->data_size - host_dm->data_start; -- 1.9.1