From patchwork Tue May 19 02:53:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186904 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp3446352ilb; Mon, 18 May 2020 19:54:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylG6BebkpuxVq6xDN//NZS+FLqwxJKwzIsaBBvkZ4pX3XxeXKaFi82obbjD6g8XVuTviZW X-Received: by 2002:a37:6857:: with SMTP id d84mr8465709qkc.42.1589856861629; Mon, 18 May 2020 19:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589856861; cv=none; d=google.com; s=arc-20160816; b=h9nqjaa2vTulu34vOl6X7S6YO7mx913p86zI5a7wUqFnMPlil0zSOfy6BqTgOASAnK 7X/EpmIWQXRABLKE7IiMMoutuf9wLfHZpGpQ0xfEyebO7lYOyQKFPCW3H87X+WOhI98f hSkDJTCTo+FthbEzklajnP6NJdZFyJqoR69erS/S3Ai6pApsVwsyJE0kQi4MjufxC4Bi W5zJrOoZflMuaJRgp1VY/GpfEE2rL+ASRH1ytG4GA2BLv6Fypyv5y8jQhVEPFtAlGnz5 xBS/DDnXsiKj1GFe9JOo12osRSZco4TJJoFzIK+47MXqhC1vI8JXovS5s6sqWmsBYzBD EF5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=AybC5+AFZZgiZxEHJk4RYMN+nVSUkMOWZVM2DrgRF3s=; b=gQlVNTl6fZNK/F4wCuMAGrEY7eZa5Pyh0gZV9IQFhpL515bG0CmY1alkr0HRHRmU4u 7Wf1JHOz7NVLxDx3lJoyLaClSh41rkHANRD4iHd0ahb3L4cvF3yiMtLOGTXZmqtJYwUm Xu/e5IIFYm35vkCstmojyZm6TIDfKbAWV819FilGtEcmEKUjpUPOjpBG9ILoGFNsrqAW HgaFUU0/9wb4OscYcCUr0aE5Y3Y77/XKM+MWxuVVqVSz7womC04/+Chm0wRu7g9q3bsi znySHV9jlG6kwACmLQ2d4s7GSnpoX9ruOS93OjOoy6Ic5KnYw5kREXZ2XAoFJAHcyjnt MyJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a4ZpaKdt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l3si6810334qtn.119.2020.05.18.19.54.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 May 2020 19:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a4ZpaKdt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jasOb-0005DZ-3l for patch@linaro.org; Mon, 18 May 2020 22:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jasOL-0005Ay-84 for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:05 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:40259) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jasOK-0002P8-F1 for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:04 -0400 Received: by mail-pj1-x1041.google.com with SMTP id ci23so711346pjb.5 for ; Mon, 18 May 2020 19:54:04 -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 :mime-version:content-transfer-encoding; bh=AybC5+AFZZgiZxEHJk4RYMN+nVSUkMOWZVM2DrgRF3s=; b=a4ZpaKdtnrsEGdVV9NMwg1AbtI8gOOs15h1CpoxTxPcFMAkYM/ASf10OXVcapBRh39 28frS27EVYX14eg7dKcYqL5oqiOuFBnEcsaSn0HblL3CzzLbWX8Lf+3/+hO3MPrhhVFJ XGVY21SJPw6q0sMHhiHv7wxiTCZWS4CKrVi9PB11g09hprqLx5Ed5YJtcVHWJ35e4TIe PwsQDcMsPyz/f7LK8UBOwDotKSVrQT4LCJ2x7EJHfGt69imPPT98oonmft5CaaiDAKLI gVMY6yI+3FnzjGRI1ig5ZVsQEbjIYNjJ7TfdpeAsx1UHv/kAlj2yrjMhCwpOtDS4Yivy jJ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AybC5+AFZZgiZxEHJk4RYMN+nVSUkMOWZVM2DrgRF3s=; b=aR4b489cfUFrulnNodmUWN9hJ49pZ8RUYS5gagZViUR4klk5wpCtGtR8PrwGNjY+xp YCFbyLNr81jBOiWqSOn1W2Ctr3tXavYn+gLELEfIyg13MC67CjvHXdPfcjxh4urmWh2r NTOjMz5kyLDox4f2EB/mRi9OjxVKK9n8eRYZ9EQraxyy+c1VfJipdtpc7+bXJbPzs1nH 48SL/pwndToA2uDiE/5MSqh/XFGo1WAFtD6MB2MBbFemotyRSo6EcFntLz9Ckw+HMkCo x1qf1gcVKuYn7DrEjRL1TwxzlpBjfAVbd43rLM7ZI8QvQYy87NoBVwrP0TvnY5wkrxln XqgQ== X-Gm-Message-State: AOAM532VGfcPIoWxTbQ23kj/2YD740kB7dZYLZtdMs+6BwGfE2z9K5GX 8BNwoeG0k5683in7fyzJUcFefTtsOZk= X-Received: by 2002:a17:90a:1464:: with SMTP id j91mr2765954pja.87.1589856842794; Mon, 18 May 2020 19:54:02 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id a2sm8772418pgh.57.2020.05.18.19.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 19:54:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [RISU v2 04/17] Adjust tracefile open for write Date: Mon, 18 May 2020 19:53:42 -0700 Message-Id: <20200519025355.4420-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519025355.4420-1-richard.henderson@linaro.org> References: <20200519025355.4420-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Truncate the new output file. Rely on umask to remove group+other file permissions, if desired. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- risu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Alex Bennée diff --git a/risu.c b/risu.c index 1c66885..f404d8f 100644 --- a/risu.c +++ b/risu.c @@ -368,7 +368,7 @@ int main(int argc, char **argv) comm_fd = ismaster ? STDOUT_FILENO : STDIN_FILENO; } else { if (ismaster) { - comm_fd = open(trace_fn, O_WRONLY | O_CREAT, S_IRWXU); + comm_fd = open(trace_fn, O_WRONLY | O_CREAT | O_TRUNC, 0666); } else { comm_fd = open(trace_fn, O_RDONLY); }