From patchwork Fri May 27 16:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 576523 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8607:0:0:0:0 with SMTP id bb7csp818881mab; Fri, 27 May 2022 10:07:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnZNEbMLhjQRTmIpVOz24VhN5lF44nDccNE1Gt9FiovqIBSU4xikDDd5IiFSSD8i2FNpNl X-Received: by 2002:a05:620a:4545:b0:6a0:74de:c70e with SMTP id u5-20020a05620a454500b006a074dec70emr28489502qkp.73.1653671248674; Fri, 27 May 2022 10:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653671248; cv=none; d=google.com; s=arc-20160816; b=FxJdf1+lpc9cmdur5u85OaPNAnGch8pRmmFlmgUyP7CMLl9forppeQRkEKpH2Lfm9L MbuJx6dI3oE82B6hcAPkF06EtyTwzIG2qxjNNwKBVzFD8+CnALoR5yqe6DvbkOUUoFbw z/CQLsu1T1l3Fx7mffh2LV/ri7kMEqXj1JiNBzgF9MkcCBNr+uj3/UA+qlM4LPD/8iTx Lxv2AA9S2Ksog2SP2YLoffyiguSTFzPv6QfO+s0eEoaTW+RCZVpmm+3ure0d1nrGNXKM JUX9JKePkVmC7TfeHsYWG6NUDts3hlXWQtsBKypNLa1rx2gfsMl0rw3cGmCaim/PvQvP k+Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=37l0ckMoMVGJpBF2TcV75mrqlQxEuC7DjW9Iu6LSXsQ=; b=cEavBI4HTglX9rAuZhig5gg/Q0vaKce2WdeAshkTmFOhlSIlJ0206YBDuyVhchF74w m6i/480BM3uiWSfDVLYsTClfQ6zirtqjl3h8Tv0n2cks+PWN1DUD2YVrZ75cv1TQd3WC VaqIcF6sitluHLHUP/l8A7BWKYV54QmAodrKYN4EF7JcuOzb1moSfD1um9IYzUMaOE+S qzh9XGjJysGpbmrXqW3vg1pkfbkhtI2kzF515PjS/rhwQ9h/q29wrE5dTLV8jM1UDDhd Ex00/hWaIW/aVIAkqhwIBxJAz8NqI7zbp95yq+wzLMlTlg7jAGceT7ccDnwo3IZkwBnn ejkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ueFR14+i; 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 f13-20020a05620a280d00b0067e4be23909si3814181qkp.334.2022.05.27.10.07.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 May 2022 10:07:28 -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=ueFR14+i; 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]:47988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nudQu-0002jp-99 for patch@linaro.org; Fri, 27 May 2022 13:07:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nud8W-0001pb-Q9 for qemu-devel@nongnu.org; Fri, 27 May 2022 12:48:29 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:50795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nud8U-0005OO-J9 for qemu-devel@nongnu.org; Fri, 27 May 2022 12:48:28 -0400 Received: by mail-pj1-x102d.google.com with SMTP id d20so957662pjr.0 for ; Fri, 27 May 2022 09:48:25 -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=37l0ckMoMVGJpBF2TcV75mrqlQxEuC7DjW9Iu6LSXsQ=; b=ueFR14+ijZS+k2WNkkM1f0iwi4l02NH40SnKM2A6Qt3oHDjpci6YNpgbrBrTjGvWb/ uUrIpxuOeYv8o1S0EIaO/62EvF2qqj39LV7K6Qi+mPvjfsH20I+ipJg4IzOVxnWbeQBv WTkXuBQh7L3rLsB9ZAML4dFiPVE6Ki67avuvOxJSwsWyjhCxQ44tYWB+X/NqubMqXFLz inNjn5etOjKNcu53ii/rEQsOAWlkVHO7/ky+T8Hoy1Xs56tx3i1jgkzHErostw/mLYWo G36kKjMetVfmozDaoN6qA7N/29KqXH5aVTQHKXGnVLbPyjwRgllUsxrCo+1fKlwr9o+4 NtUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=37l0ckMoMVGJpBF2TcV75mrqlQxEuC7DjW9Iu6LSXsQ=; b=jec4k4w/GEsdITiUFILufpywVl8+0/1CmdjrBOpAx43TRSH2+IjbOper+N1u/in0yJ 4RMP6tuNuphMbYQITpvyNT0sUfXXA6if3bX+oyfPl8Z51kz+gt9uT6fuUQT4A8cAfXkd bk/2gvAyt7ugtYzyDkPq7uK8hSG7t/sB6hYunrcNGcBn0Nkw5GqVD73Aqqhio04Zw/M0 rShg8vmhiu6c9MA2kOOwPvaFRH4lXCZA5wCywLMzHcJ1yQgJkCJdkGgCW080rV8aR2pY DeTY0ag4godrDgkSXTp1dqs/ivbajcUBfpamXrR0SNL7RX1rdBxF7IcbWdHzhY/IqGml ZXFw== X-Gm-Message-State: AOAM531jwpSNd9W/6NOWggpr9nojkm8/hisBVebi1UmYfd6m0NMYjmUY IH1dsi1aVZqWoGA9OyO8yiF+WP2mDnbRzA== X-Received: by 2002:a17:90b:3e8a:b0:1e0:51fa:516b with SMTP id rj10-20020a17090b3e8a00b001e051fa516bmr9355922pjb.151.1653670104710; Fri, 27 May 2022 09:48:24 -0700 (PDT) Received: from stoup.. (174-21-71-225.tukw.qwest.net. [174.21.71.225]) by smtp.gmail.com with ESMTPSA id j11-20020aa7928b000000b0050dc7628133sm3861420pfa.13.2022.05.27.09.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 09:48:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 15/17] linux-user/strace: Use is_error in print_syscall_err Date: Fri, 27 May 2022 09:48:05 -0700 Message-Id: <20220527164807.135038-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220527164807.135038-1-richard.henderson@linaro.org> References: <20220527164807.135038-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Errors are not all negative numbers: use is_error. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 9fa681dea9..7d882526da 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -689,7 +689,7 @@ print_syscall_err(abi_long ret) const char *errstr; qemu_log(" = "); - if (ret < 0) { + if (is_error(ret)) { errstr = target_strerror(-ret); if (errstr) { qemu_log("-1 errno=%d (%s)", (int)-ret, errstr);