From nobody Mon Feb 9 00:30:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1691059005; cv=none; d=zohomail.com; s=zohoarc; b=MKvJ7M5NVNRpmsO0nU/Nxh9yMgl/wNlsqjNN8naExGJjaQ79BZk6UYJe5sHaJ1cGmeioggidG/kpTkKjCQ8P4Iu4x+L7Ikkl2SHK+k3fnCObjovJx6nX4n2JfytZqIsosys65MpX3AMNJLZRa4qr724vIGU+patWEZGAOSOIzzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691059005; 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=inw8sfUYHUh+GZuTeP/yiDQ4MeHcvi8LfnvPFyLXzg8=; b=kdUTACr62FU7+8t4a70uLXLYX8m0niKoHuD5M2Ha1S0YhbX83VFSFnn9dbYzS+fg/JpnG4xcvt5LsxAdWICdb1Jcg/TQyFKcuD4maG8lnX8XGr9U1CTssXNek7voTbOUcNNsjxRwk1S2xqEcriVfuvvI649twA/eiA834tVJQQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1691059005364945.5251106495961; Thu, 3 Aug 2023 03:36:45 -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-630-B1BQdL36MO-zVnKhByT3Tw-1; Thu, 03 Aug 2023 06:36:40 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D2C08910F5; Thu, 3 Aug 2023 10:36:37 +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 7575F207B34D; Thu, 3 Aug 2023 10:36:37 +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 51DE819451E4; Thu, 3 Aug 2023 10:36:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C53BE1947218 for ; Thu, 3 Aug 2023 10:36:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B5C92F77BD; Thu, 3 Aug 2023 10:36:28 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D171F7FB4 for ; Thu, 3 Aug 2023 10:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691059004; 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=inw8sfUYHUh+GZuTeP/yiDQ4MeHcvi8LfnvPFyLXzg8=; b=aAZbz5h/JkPkuNcDhu29EkEJ9Et1Jfe9NcNFY0V8mXhUpcp73Bts83MyFTiyhAF/L4QzM1 Z22xs+CQNOlr1GVcmv2hvlxjua+/cd8Q71664nsC/d0Uzd1EseTi5IIu2ACk/D5WVGPzQS 7k5YFZy58qBtZ02NCtnabqzEvj6Zh2o= X-MC-Unique: B1BQdL36MO-zVnKhByT3Tw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 10/13] virnetdaemon.c: Use struct zero initializer instead of memset Date: Thu, 3 Aug 2023 12:36:17 +0200 Message-ID: <864feb8ede33267e2734048c0a8b25d253880ea0.1691058853.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.4 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: 1691059006510100007 Content-Type: text/plain; charset="utf-8"; x-default="true" Ideally, these would be fixed by coccinelle (see next commit), but because of various reasons they aren't. Fix them manually. Signed-off-by: Michal Privoznik Reviewed-by: Claudio Fontana --- src/rpc/virnetdaemon.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 554b8852e4..d37984d207 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -134,7 +134,7 @@ virNetDaemonNew(void) { virNetDaemon *dmn; #ifndef WIN32 - struct sigaction sig_action; + struct sigaction sig_action =3D { 0 }; #endif /* !WIN32 */ =20 if (virNetDaemonInitialize() < 0) @@ -160,7 +160,6 @@ virNetDaemonNew(void) dmn->autoShutdownTimerID =3D -1; =20 #ifndef WIN32 - memset(&sig_action, 0, sizeof(sig_action)); sig_action.sa_handler =3D SIG_IGN; sigaction(SIGPIPE, &sig_action, NULL); #endif /* !WIN32 */ @@ -599,12 +598,10 @@ virNetDaemonSignalHandler(int sig, siginfo_t * siginf= o, { int origerrno; int r; - siginfo_t tmp; + siginfo_t tmp =3D { 0 }; =20 if (SA_SIGINFO) tmp =3D *siginfo; - else - memset(&tmp, 0, sizeof(tmp)); =20 /* set the sig num in the struct */ tmp.si_signo =3D sig; --=20 2.41.0