From patchwork Thu Jun 2 01:33:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 578092 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp113840max; Wed, 1 Jun 2022 18:56:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzq8pG15cF7A204T3a+0ZKXcUprzABMYkrgEs91eGW8rKOkRqv1WNFr43V2OA99wt2t6R3 X-Received: by 2002:a05:622a:196:b0:304:b3a0:54af with SMTP id s22-20020a05622a019600b00304b3a054afmr2145106qtw.368.1654134997263; Wed, 01 Jun 2022 18:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654134997; cv=none; d=google.com; s=arc-20160816; b=n9DaisWNYaW2wqaPlRSfsGvARBgsusBfsJ3NMyJB1vIPDmjvDI/HMbhCqAjiK8IwY5 OB97xdQM13k5a/6PboWxbZTqdrOPEL4pPXFCpAQ6tB7cDsV2KN1/WMBgROE/4O2/FB5b zsdviHBIcSHucGfthZJvYQeECtIDpHZ8KInk3X8LIYZDv6p3G5PU88KDGS/uUWLWonBZ jgQmcKyaFScJ7b2bJBF4uW8bTuSSoi5rkvGm9aTJC4IrhbgHOcjWRqdYlwOEbb05rrFX bNxApqzvU4PvtZFEgdIRwtLDcxarIBkTC+KfEcgzcw+D6R8/fHHJA2v++J2k8ZUcHlhq UNUQ== 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=oPfvkA1xro/0Dhs7q9PmCMHrROsySKsrfNaSRvKbkwR6Jk1TPpV9pWs3gVdufx8xWz gtAkQ8wtbBjmpJ/6sgpw6qeA/ch67k+g0J1TM7iSL+yRD7tZwVFCIyKfvULi5k0Ejwvt BccwuuPj6eexKJcEA8efVIHOXctSkliHSFae34cqIU+yRJlmAkLwYu+hkI0ObZu2CZwr H4KBymHQFTbixXrW9eqbf1/GvdANp+HPL/NXdAVMrgX+PJGTkEIgJgByUp7DIb6q0ZMZ Lzg1fBccbePVfEoI9ssIN/RgD3vhAP2XoYluqpiBIzWMizXZ2KZDJYBB2hFrWj6kb48O hBdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cv+sXEfF; 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 e7-20020ac84e47000000b00304bdbfd2f7si1965116qtw.113.2022.06.01.18.56.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Jun 2022 18:56:37 -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=cv+sXEfF; 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]:55550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwa4i-0002Mx-Tf for patch@linaro.org; Wed, 01 Jun 2022 21:56:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwZjM-0002j1-LU for qemu-devel@nongnu.org; Wed, 01 Jun 2022 21:34:32 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:37439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwZjI-0005ID-QR for qemu-devel@nongnu.org; Wed, 01 Jun 2022 21:34:32 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 3-20020a17090a174300b001e426a02ac5so4797994pjm.2 for ; Wed, 01 Jun 2022 18:34:23 -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=cv+sXEfF3W2Hx9oQlNLC7QdpICSYeu/+RbiT8O7yV6EaOAWQkJcdjJnpwDW99qmq3s Lt8By4O1T7vUOWUUBI7Uuc0E5ZuKJKaJtCypVQkHehJzoZhnn3oARM4d96m2hatQAzGA QVFV42xw4QwQaRDpsD0JhK8pA8GFTrNM3MLKuSoAnXQK7P5g0Exyy5HNz/0v9Gjlfj9m iZE/yEoMuFJUJmvL40mMZnViADDagMNncpqLWVAo7sIArJMQ49QRep6xl9CYZLBYEGGg ayDKL9MuMvngvuU/YMCHOPJRqdpNAGT41MaZ6JzbrKMnkcoUusEkeyov5XWJ8s+LRNJ6 2jcA== 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=08+ExP3dD1sO2FpCkT9l0hCynAjijLq24keKxTMsuMFBi6SOH5Y0qhtFMTZcFwSYIj Hm9lBJDllrxd1AYWv5ZpRng0MNp1oTwDq1q5E/AOo9DEJczMn/UTjkYj/kr/PEPkKh6P kYeBxEN0UrsDlqUUKmVo/N2T+DFqFEkSrrxJkvYTDL6bUSxEjv7crGTFBSYVxmAmDgHh b40ifbgwNm3sH7G+M6G06Gx0xVNcA7k7aGJ5ZF39fHJhn/I1LCS8m5yvP9JW32IF/Umi aBCZAU1tMuMq0b+gbliLSzydBCcO2ihMQNmWdHIO2i8UJCtDJQn++hWP6kVUwAP9qZ5A 519g== X-Gm-Message-State: AOAM533mx/rd8ZHvhwLtEqABpsTIsymF6Y3n9WXL41SqE4CkVHAdC0QI NAldF7cg5C2e5br6gg1Q0BD9Vu5FhPTNAw== X-Received: by 2002:a17:902:e5c9:b0:166:34ff:72a3 with SMTP id u9-20020a170902e5c900b0016634ff72a3mr2299539plf.80.1654133662318; Wed, 01 Jun 2022 18:34:22 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:1eca:8ee3:9269:e00c]) by smtp.gmail.com with ESMTPSA id l191-20020a6391c8000000b003fc5b1db26fsm1962875pge.52.2022.06.01.18.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 18:34:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v6 15/17] linux-user/strace: Use is_error in print_syscall_err Date: Wed, 1 Jun 2022 18:33:59 -0700 Message-Id: <20220602013401.303699-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602013401.303699-1-richard.henderson@linaro.org> References: <20220602013401.303699-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 --- 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);