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: 69644 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2504562qgf; Wed, 8 Jun 2016 06:46:23 -0700 (PDT) X-Received: by 10.140.254.213 with SMTP id z204mr4884525qhc.56.1465393583499; Wed, 08 Jun 2016 06:46:23 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y200si694281qhy.109.2016.06.08.06.46.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:46:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdoN-0001DK-1L for patch@linaro.org; Wed, 08 Jun 2016 09:46:23 -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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.1.4 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: {