From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZd-0004VX-NC for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZX-0005pT-BC for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:08 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:33722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZX-0005pL-3I for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:03 -0400 Received: by mail-lf0-x22f.google.com with SMTP id s64so5906737lfe.0 for ; Wed, 08 Jun 2016 06:31:02 -0700 (PDT) From: riku.voipio@linaro.org Date: Wed, 8 Jun 2016 16:30:10 +0300 Message-Id: <2a3c7619288af9cfcc09a233dce911bf80849dfb.1465392531.git.riku.voipio@linaro.org> In-Reply-To: References: Subject: [Qemu-devel] [PULL 29/44] linux-user: Use safe_syscall wrapper for connect syscall List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell From: Peter Maydell Use the safe_syscall wrapper for the connect syscall. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e0c49cc..b363944 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -714,6 +714,8 @@ safe_syscall2(int, tkill, int, tid, int, sig) safe_syscall3(int, tgkill, int, tgid, int, pid, int, sig) safe_syscall3(ssize_t, readv, int, fd, const struct iovec *, iov, int, iovcnt) safe_syscall3(ssize_t, writev, int, fd, const struct iovec *, iov, int, iovcnt) +safe_syscall3(int, connect, int, fd, const struct sockaddr *, addr, + socklen_t, addrlen) static inline int host_to_target_sock_type(int host_type) { @@ -2859,7 +2861,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr, if (ret) return ret; - return get_errno(connect(sockfd, addr, addrlen)); + return get_errno(safe_connect(sockfd, addr, addrlen)); } /* do_sendrecvmsg_locked() Must return target values and target errnos. */ -- 2.1.4