From nobody Sun May 19 11:31:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linutronix.de ARC-Seal: i=1; a=rsa-sha256; t=1681906081; cv=none; d=zohomail.com; s=zohoarc; b=bTbLOff8xyjUpS3Lkchwv0UxPjeaCvWQ59We2xw34UdYIC3ItUs8eR9I26W7cBCzv8p4RqF+83dCBBiFJv8bs2bb5NtycM11im4N+Xp3bAfzB1KHLATOmELKjw5QBwkfiJPmUS8VpKyEa4xHLmBt+RpFSF+VmqC16j8pcf8PrhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681906081; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=uB/axOQ5En9PckK/Aq+OqwZra7JiQP1h450lnS9RVyM=; b=fUJmf8anqeeZLirDDEwlqF8f5Wx608g95QWWhf/5sEazIDgbueDFvDTsTG/5M72gKpreosa04KIRfixmxiKHqM6FsSnNVuncGvyCKBc61W3zYDoK0ZxrArn2LeDX3gSxphlhO58qhy1gEZkOBT3dx0fu5c7MgR04nuR7YwUM16s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 168190608166872.27401468215851; Wed, 19 Apr 2023 05:08:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.523392.813395 (Exim 4.92) (envelope-from ) id 1pp6al-0003Ky-Bh; Wed, 19 Apr 2023 12:07:19 +0000 Received: by outflank-mailman (output) from mailman id 523392.813395; Wed, 19 Apr 2023 12:07:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pp6al-0003Kq-8q; Wed, 19 Apr 2023 12:07:19 +0000 Received: by outflank-mailman (input) for mailman id 523392; Wed, 19 Apr 2023 12:07:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pp6aj-0003Kg-Tb for xen-devel@lists.xenproject.org; Wed, 19 Apr 2023 12:07:17 +0000 Received: from galois.linutronix.de (galois.linutronix.de [2a0a:51c0:0:12e:550::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b8ac257e-deaa-11ed-8611-37d641c3527e; Wed, 19 Apr 2023 14:07:15 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b8ac257e-deaa-11ed-8611-37d641c3527e From: Alexander Kanavin DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681906034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=uB/axOQ5En9PckK/Aq+OqwZra7JiQP1h450lnS9RVyM=; b=iF8gDbav+fN6Eyk58sDi7615PCC6ZzLC9zAHucwDBKETpxMhdI+XDS9+lfal4ZbN9C5OIN oHnhx2bUTq7xx1xNLjonuvFa4IwTbqNdHQ5fsW9DU4c1oIfylmH+O9xB8t3Z0kMGNdE81/ Tq0Ag872mbLJYUVVDsYSa1qgFqT4HSbRGFUlkhYAf5sgT5inZ0/6KmZif4tpDKJEmRct+Z J31PCoKp8TUgm1NvEBcq8tZDOD3BHxvFISDflSKkDrC9UEcDalrKwRc4sqd9/mUCg0S5D/ IzitHA3lUbvHM2/LKYzJcXdIR0lpn9uQTTPcABrFvqf+AK7ja5v7qUBTCfb7ZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681906034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=uB/axOQ5En9PckK/Aq+OqwZra7JiQP1h450lnS9RVyM=; b=3slBlkz2qwt9oXtBNR+XVv1opP7r0DPcWckCgI9aPsIE2ggyok7RJW8g1OfMrQ0cgjyVdL q/96aaEPUpq6I7AQ== To: xen-devel@lists.xenproject.org Cc: Alexander Kanavin , Wei Liu , Juergen Gross , Julien Grall , Anthony PERARD Subject: [PATCH v2] tools/xenstore/xenstored_control.c: correctly print time_t Date: Wed, 19 Apr 2023 14:07:09 +0200 Message-Id: <20230419120710.855128-1-alex@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linutronix.de) X-ZM-MESSAGEID: 1681906082992100001 Content-Type: text/plain; charset="utf-8" On 32 bit systems with 64 bit time_t (hello, Y2038 problem), the following error occurs otherwise: | xenstored_control.c: In function 'lu_reject_reason': | xenstored_control.c:646:70: error: format '%ld' expects argument of type = 'long int', but argument 5 has type 'time_t' {aka 'long long int'} [-Werror= =3Dformat=3D] Signed-off-by: Alexander Kanavin Reviewed-by: Juergen Gross --- tools/xenstore/xenstored_control.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_= control.c index cbd62556c3..403295788a 100644 --- a/tools/xenstore/xenstored_control.c +++ b/tools/xenstore/xenstored_control.c @@ -666,12 +666,12 @@ static const char *lu_reject_reason(const void *ctx) time_t now =3D time(NULL); =20 list_for_each_entry(conn, &connections, list) { - if (conn->ta_start_time && - (now - conn->ta_start_time >=3D lu_status->timeout)) { + unsigned long tdiff =3D now - conn->ta_start_time; + + if (conn->ta_start_time && (tdiff >=3D lu_status->timeout)) { ret =3D talloc_asprintf(ctx, "%s\nDomain %u: %ld s", ret ? : "Domains with long running transactions:", - conn->id, - now - conn->ta_start_time); + conn->id, tdiff); } } =20 --=20 2.30.2