From nobody Sun Sep 22 09:36:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XBLcM1C5yz5Wdyl; Sun, 22 Sep 2024 09:36:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XBLcL5yyhz4T7q; Sun, 22 Sep 2024 09:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997810; 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; bh=0VHOFZyGn5gCjaMgpCCwYk5Df+EZh5PET1TM49voFOQ=; b=VBTBtJ0Ngh6ShgF8Qg/92rT02ITAQ9rRHdpgJG8XjyCtZzKv/fIkVTKdEUWLdzfrEH+cSJ lfUT3Ec6VgAwxViRnwrxnCUA4GfRZs+iSpDU5aEG0Z8UCq9G2GCUuu5KbOKLUdPeNlZ3/U QSAjv37Vu9FdU8f/Q16ylDqECYzCY7KljrvRAlDJCcfOjskz2whFET+qQIFUcsL2b/XBJO yOgvqndcvT25+bU6ojvYOs3ibDUBZ1rY/Y26G8+rO1Jq4dK1h3RSJ+5EPH6EFpu0kwJlNX az0Uaq94h+6LvqvvgFfUbunIN3WuOVLRy+AC9atmsRR1q4xUwGi665mw/XuIqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726997810; a=rsa-sha256; cv=none; b=tHsFr8UlLyRCmU4EPs3Cz57xajSXl+fdGlk+gavfRsWL2vl51CUVwY0bdhrJH0drO9rOQa L5dREj5dVhyGlVBGUNn2xGf/OJzyC1Qz1+S7YsUi65HAA/2+7k5U6nZXqIXHsThhbubkSB /Cuywg98S172GTeKd/WqMeg4uiARRlAWbWLtnSRbFQ2l2ZyozjcicoZneJeAwLbnyS8mSi dN5qvTc8W2TpZ85G1lRorNlnSw7UdZCaLDzX1go5PGQt5FM7IMTXrdE5JE7/DzWsGLHCor 6NsBMMpSkV2VTHkUoCkLdiBABLHJh6vJxXpr8z6rRVd6KOpejNUMLQ41m0Xi6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726997810; 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; bh=0VHOFZyGn5gCjaMgpCCwYk5Df+EZh5PET1TM49voFOQ=; b=fkAC8lSsAe2uJcilToQb8s+DoueOJkJBJ3eBIyUDj/FDAEpFMCccpKr0bmDDRZiekKQHEh sDml6Qp6Q7ellKTXfnks5ZdPLEuEiI5Ns23TVrqmPa9E7qpY617Xg5lQIZl1u1WAN7hznx zOHlagkzMnwDxOZtRAXQnhRREjYba84fbwQAGvepP0KgZEsALMzpr6VW2/rcXK//+APCW/ xmiWpx1SaYr97QILJQ4arijeuDTXAGSfSxbc6S9RHSeXaSzO5pcJQHBKqaADCKnjk838Xt XSRA6HvTteX8E3KfXm/+N1UGPOsTaDd3YKNAqUoKrDrUGsmUXcFj2TFZUwBvxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XBLcL5ZzJz1BM3; Sun, 22 Sep 2024 09:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48M9aoGc000783; Sun, 22 Sep 2024 09:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48M9aoU7000780; Sun, 22 Sep 2024 09:36:50 GMT (envelope-from git) Date: Sun, 22 Sep 2024 09:36:50 GMT Message-Id: <202409220936.48M9aoU7000780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 50c03711f28a - stable/14 - procstat(1): make rlimit_param[] size assertion automatic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 50c03711f28a69e6e1811414abd8e4d191d3445d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=50c03711f28a69e6e1811414abd8e4d191d3445d commit 50c03711f28a69e6e1811414abd8e4d191d3445d Author: Konstantin Belousov AuthorDate: 2024-09-14 13:15:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-21 21:19:49 +0000 procstat(1): make rlimit_param[] size assertion automatic (cherry picked from commit e3b777534baeb69a1ee88d0b18c76a68eacdb34e) --- usr.bin/procstat/procstat_rlimit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.bin/procstat/procstat_rlimit.c b/usr.bin/procstat/procstat_rlimit.c index f2dcfcd47327..f930d5b0aee0 100644 --- a/usr.bin/procstat/procstat_rlimit.c +++ b/usr.bin/procstat/procstat_rlimit.c @@ -48,7 +48,7 @@ static struct { const char *name; const char *suffix; -} rlimit_param[15] = { +} rlimit_param[] = { {"cputime", "sec"}, {"filesize", "B "}, {"datasize", "B "}, @@ -66,9 +66,8 @@ static struct { {"umtxp", " "}, }; -#if RLIM_NLIMITS > 15 -#error "Resource limits have grown. Add new entries to rlimit_param[]." -#endif +_Static_assert(nitems(rlimit_param) == RLIM_NLIMITS, + "Resource limits have grown. Add new entries to rlimit_param[]."); static const char * humanize_rlimit(int indx, rlim_t limit)