From nobody Mon Feb 9 01:16:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1659444727; cv=none; d=zohomail.com; s=zohoarc; b=mULs5LIxvO5TL29KF++s7avtgmuAU4YhZaYetGEsRY57A0wRrCwRXoCS1RlGXi8HLXFwPnKiiODFtn67ZEiDDeiEq5mktFc+s0WoSZ7onjM2CBy5ComSiA9qKZJb4Esd1iVi8SoJ6dHa+z/XfHxFu1fzOZN1GoMFWziob2XIGkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659444727; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bXnBKodO8my+YEz76nLSxCCBV0/5pP0R5F2A6eAoGmA=; b=EeUEuqcw8pff3qN0vNDmYpzAJJE2G67+g4yEXTkKmZ/JYMqUkDgXs2VdUadVt8uBRhMBCT8pD12ZvM7p8CjdtumLEBmtcdliQzJ82PIgpBo2ZGIrgJEPRtavUID6EB4dTQfBih1qJAi2UBeEX+0kWLdgBRtsDL24+K83oGI0F+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1659444727749928.0636268859162; Tue, 2 Aug 2022 05:52:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-501-5cZIp7sYMCu71N2YS-__Cg-1; Tue, 02 Aug 2022 08:52:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E92985A586; Tue, 2 Aug 2022 12:51:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B71112166B2C; Tue, 2 Aug 2022 12:51:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9C7631946A4D; Tue, 2 Aug 2022 12:51:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C5A451946A52 for ; Tue, 2 Aug 2022 12:51:55 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B1BA9492CA6; Tue, 2 Aug 2022 12:51:55 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29E01492CA2 for ; Tue, 2 Aug 2022 12:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659444726; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bXnBKodO8my+YEz76nLSxCCBV0/5pP0R5F2A6eAoGmA=; b=MHZNWGqmJTANkMccQij3zBqtwPdoVPbh/Fd8W8aWek7Uuujh3b+rxHzFcDuGubSjvHyUej sqhbCSGfX6+eYqvSQ1dVPWGNxyljlOMAOV+fjZLfyOmkTWbPd8CV5ljDupOGgJBk0lS9Hn HwSfb1u/LSGmvyzdVuHP66eiSKUDu3Y= X-MC-Unique: 5cZIp7sYMCu71N2YS-__Cg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/6] qemuMonitorOpenUnix: Don't overwrite 'ret' needlessly Date: Tue, 2 Aug 2022 14:51:48 +0200 Message-Id: <3715e7d368b0f6e7009dea9039418d27bc482d3c.1659444625.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659444729390100007 Content-Type: text/plain; charset="utf-8" Directly check the return value of 'connect'. Unfortunately we can't remove it as we have to undo auto-closing of the socket on success. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ad5e121359..0c0b07d4a5 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -245,8 +245,7 @@ qemuMonitorOpenUnix(const char *monitor) return -1; } - ret =3D connect(monfd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { + if (connect(monfd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { virReportSystemError(errno, "%s", _("failed to connect to monitor socket")); return -1; --=20 2.36.1