From nobody Sun Dec 14 06:22:00 2025 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; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1751634421; cv=none; d=zohomail.com; s=zohoarc; b=MLxPx9IEoChIqoWvsLHO8xakULHHGVpUJBYSiS9tlMlcjVPGn+ROqDlHMK22nDXkIDiBiYJmxB6SpiK6AYGAETuhUQLyMsjq43hzhH+8aVAtov43Dpz+LajY5ZW0ZtLTCaQf6VqpaG3ObXZTqLVCYLXQD6UZpmZSJFHjPg0sqDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751634421; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=k6sMeXBaXDk9gVRscyOpMOFtXbjn3YBMfEjMXCT8pys=; b=nAjgJHFu2bp3T1jakfCp3APC609yuYgeUJ4e7wecxTFOguoPLRmt9sBSJF2P+I0AUobWNQtZ/O4+x7hwhdfbeySbO3subY8imIJfaDwq+BJZRZpw/vm/yI251SxY4gRwYiMX7JjeyhyH/Vxl5dCtSwRP5RCSUvjH0QMMECRllMU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1751634420665773.8250627627023; Fri, 4 Jul 2025 06:07:00 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id B57DE11C4; Fri, 4 Jul 2025 09:06:59 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 66B5214F0; Fri, 4 Jul 2025 09:06:16 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4BE55E1E; Fri, 4 Jul 2025 09:06:10 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 C9513DE5 for ; Fri, 4 Jul 2025 09:06:09 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-FHAuxtGIOUmVvlz1iv8jig-1; Fri, 04 Jul 2025 09:06:07 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2A7A01944AA9 for ; Fri, 4 Jul 2025 13:06:07 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E4EF18002B5 for ; Fri, 4 Jul 2025 13:06:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751634369; h=from:from: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; bh=Y6oVLfiYFD/CqYOawhCDaDCYtuG3rlL56KQMjDiF1OE=; b=NnyqAnEQQlUm9R30GpMc0/C6/cezddMPCt2loFxz03Vax1fIc00oOebyKXPAhVM4pBNMap bn0qByHy2ge/IuLuwxDkxyboTtCdU89O2SwgQTqeWNkey08/q8SfJzAuKcVGkVCIjHDvKy 8gXPgBtg6g4+pTNL3f4FKEHhHCR7DRM= X-MC-Unique: FHAuxtGIOUmVvlz1iv8jig-1 X-Mimecast-MFC-AGG-ID: FHAuxtGIOUmVvlz1iv8jig_1751634367 To: devel@lists.libvirt.org Subject: [PATCH 1/6] nss: Promote debug message to proper error when time() fails Date: Fri, 4 Jul 2025 15:05:30 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: byRkIFWAIaK8xFAhTY4DlM63sNrWA2b-zfImE2KfjDM_1751634367 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XXZYU3JOLK365BXOTP3LBRTVCT24RV4R X-Message-ID-Hash: XXZYU3JOLK365BXOTP3LBRTVCT24RV4R X-MailFrom: mprivozn@redhat.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header 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: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1751634421733116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The difference between DEBUG() and ERROR() macros is that the latter also prints (stringified) errno. Inside of findLease() there's one line where time() is called which is documented as: On error, ((time_t) -1) is returned, and errno is set to indicate the error. Therefore, don't just print DEBUG() but ERROR() so that the cause for the error is printed too. Signed-off-by: Michal Privoznik --- tools/nss/libvirt_nss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index 6ee328a8df..52b769d760 100644 --- a/tools/nss/libvirt_nss.c +++ b/tools/nss/libvirt_nss.c @@ -174,7 +174,7 @@ findLease(const char *name, #endif =20 if ((now =3D time(NULL)) =3D=3D (time_t)-1) { - DEBUG("Failed to get time"); + ERROR("Failed to get time"); goto cleanup; } =20 --=20 2.49.0