From nobody Fri Dec 27 12:42:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1732800877902429.7146497645215; Thu, 28 Nov 2024 05:34:37 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4789F1CC5; Thu, 28 Nov 2024 08:34:37 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 791F619BE; Thu, 28 Nov 2024 08:33:32 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9A5ED196D; Thu, 28 Nov 2024 08:31:55 -0500 (EST) Received: from air.basealt.ru (air.basealt.ru [193.43.8.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 07F80194C for ; Thu, 28 Nov 2024 08:31:55 -0500 (EST) Received: from kuznetsovam-nb.office.basealt.ru (unknown [193.43.10.250]) by air.basealt.ru (Postfix) with ESMTPSA id E4236237B3; Thu, 28 Nov 2024 16:31:53 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 From: Alexander Kuznetsov To: devel@lists.libvirt.org Subject: [PATCH v2 4/4] logging: Change return type of virLogDaemonConfigFilePat to void Date: Thu, 28 Nov 2024 16:28:10 +0300 Message-ID: <20241128133105.31975-5-kuznetsovam@altlinux.org> X-Mailer: git-send-email 2.42.2 In-Reply-To: <20241128133105.31975-1-kuznetsovam@altlinux.org> References: <20241128133105.31975-1-kuznetsovam@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: kuznetsovam@altlinux.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: I2LH47RQGNTYTGENCT3CSHUDCHVPONUJ X-Message-ID-Hash: I2LH47RQGNTYTGENCT3CSHUDCHVPONUJ X-Mailman-Approved-At: Thu, 28 Nov 2024 13:33:24 -0500 CC: nickel@altlinux.org, egori@altlinux.org, pkrempa@redhat.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZM-MESSAGEID: 1732800878912019100 Content-Type: text/plain; charset="utf-8" This function return value is invariant since 18f3771, so change its type and remove all dependent checks. Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Pavel Nekrasov Signed-off-by: Alexander Kuznetsov Reviewed-by: Jiri Denemark --- src/logging/log_daemon.c | 8 ++------ src/logging/log_daemon_config.c | 4 +--- src/logging/log_daemon_config.h | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index daf7ef4b2f..5a9be4a44e 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -692,14 +692,10 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } =20 - /* No explicit config, so try and find a default one */ + /* No explicit config, so find a default one */ if (remote_config_file =3D=3D NULL) { implicit_conf =3D true; - if (virLogDaemonConfigFilePath(privileged, - &remote_config_file) < 0) { - VIR_ERROR(_("Can't determine config path")); - exit(EXIT_FAILURE); - } + virLogDaemonConfigFilePath(privileged, &remote_config_file); } =20 /* Read the config file if it exists */ diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_confi= g.c index 248bd927d3..60c424ad84 100644 --- a/src/logging/log_daemon_config.c +++ b/src/logging/log_daemon_config.c @@ -33,7 +33,7 @@ VIR_LOG_INIT("logging.log_daemon_config"); =20 =20 -int +void virLogDaemonConfigFilePath(bool privileged, char **configfile) { if (privileged) { @@ -45,8 +45,6 @@ virLogDaemonConfigFilePath(bool privileged, char **config= file) =20 *configfile =3D g_strdup_printf("%s/virtlogd.conf", configdir); } - - return 0; } =20 =20 diff --git a/src/logging/log_daemon_config.h b/src/logging/log_daemon_confi= g.h index 43922feedf..5c10cc50d7 100644 --- a/src/logging/log_daemon_config.h +++ b/src/logging/log_daemon_config.h @@ -39,7 +39,7 @@ struct _virLogDaemonConfig { }; =20 =20 -int virLogDaemonConfigFilePath(bool privileged, char **configfile); +void virLogDaemonConfigFilePath(bool privileged, char **configfile); virLogDaemonConfig *virLogDaemonConfigNew(bool privileged); void virLogDaemonConfigFree(virLogDaemonConfig *data); int virLogDaemonConfigLoadFile(virLogDaemonConfig *data, --=20 2.42.2