From patchwork Wed Jun 8 13:30:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9164685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9141360467 for ; Wed, 8 Jun 2016 13:44:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 853FE20410 for ; Wed, 8 Jun 2016 13:44:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A39326B4A; Wed, 8 Jun 2016 13:44:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FSL_HELO_HOME, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C53420410 for ; Wed, 8 Jun 2016 13:44:37 +0000 (UTC) Received: from localhost ([::1]:57078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdme-0008LX-32 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 09:44:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZf-0004Xz-Tv for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZe-0005qq-3Y for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:10 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:35701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZd-0005qZ-Sn for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:10 -0400 Received: by mail-lf0-x22c.google.com with SMTP id u74so5856783lff.2 for ; Wed, 08 Jun 2016 06:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=S1y/1Vqd//bzXFym5x4TffUHBfCss0Lzho/0jPZ39eM=; b=ZUQk9VSWSNgzuvbM2HscqDOEE6vH1BbkX6iOM6UTJquzrVdXYCljOxgTW985ZDc3+5 ZSeDnq594ljCTyF3X/NLawHO8yigEkZt+ZWLmG4PzYoAr7ZthmGBXCxLC+7/Dq70ihKL aacVSMR9nS9Gp7iKWkH16eS1VP8+4q3Vgpvpk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=S1y/1Vqd//bzXFym5x4TffUHBfCss0Lzho/0jPZ39eM=; b=fEMlLEAKSrBZrrEXdJSJ7NcWufIvCKZUPDySvh2Rs6OQDNX397pKvyJ1UO/Ne/2evj Lje3zgW708f/lQRIGAyXoSlariPnZKKI/kmzgk3aQT5ErhuiSkBt07OhS2ZyKRoyCIN9 vtZMt9wPxqn8jTUvscEIAk6lWRZX5douNWxkOAyS2emZKNdPTJ3DePZtpFVEl/eAfCcG 9O5AByjQ5IO7qigVbbDLU3ChR2RZR8JQfH86+yCMMjdJK3uj9PLN1L+x9S2v5S0YNt5X yexWc/SgZC/0pJbCDR2/RZ/niSQVvHV0aor75WEVeAsPDggwGIB/x73elqHRIutkfZw8 w3SA== X-Gm-Message-State: ALyK8tIfW672KhQ4uBa3q+oJ7vqSRh9r7WuSbU1HOid040Msoj4C8kbepvJWMWEz5BE+6+kY X-Received: by 10.25.168.9 with SMTP id r9mr3671701lfe.18.1465392666759; Wed, 08 Jun 2016 06:31:06 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.31.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:31:06 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:30:14 +0300 Message-Id: <2a8459892f83ad563efc8a3b29db766ebe986447.1465392531.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22c Subject: [Qemu-devel] [PULL 33/44] linux-user: Use safe_syscall wrapper for flock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell Use the safe_syscall wrapper for the flock syscall. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 294e5ee..7d88009 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -722,6 +722,7 @@ safe_syscall6(ssize_t, recvfrom, int, fd, void *, buf, size_t, len, int, flags, struct sockaddr *, addr, socklen_t *, addrlen) safe_syscall3(ssize_t, sendmsg, int, fd, const struct msghdr *, msg, int, flags) safe_syscall3(ssize_t, recvmsg, int, fd, struct msghdr *, msg, int, flags) +safe_syscall2(int, flock, int, fd, int, operation) #ifdef __NR_msgsnd safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz, int, flags) @@ -9025,7 +9026,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_flock: /* NOTE: the flock constant seems to be the same for every Linux platform */ - ret = get_errno(flock(arg1, arg2)); + ret = get_errno(safe_flock(arg1, arg2)); break; case TARGET_NR_readv: {