From nobody Tue Oct 10 02:49:30 2023 X-Original-To: dev-commits-src-main@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 4S4L2y5mPKz4wy06; Tue, 10 Oct 2023 02:49:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S4L2y5G2jz4QL0; Tue, 10 Oct 2023 02:49:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696906170; 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=DU2r+q869nDnMjlS80UWCCOwgSzD4WIbViYGalYTUSY=; b=ahbcL/ZGAMKGXNp69HmZAkYdsmB1YS+uemRPpB5bAEl+69zSZCPn+9Kd/bHmYbD3zggSHN jjdG0NWzKdv9ytfeRtjgu7UfaFe5d/XxsNPzRnavfFe2UhkIn8mL7xrOL/XgwmtAuDFT3T ga87ng3yl86qAXwKS6n5/2/pqYCpTLZXFCWRzyruXNSoSS5kAGBTjSbEncSIlMvX2D3UM5 mr0oR1UoJ6c22SW0f3A+36WOOVY4Bmzz2P9U0MDBR5c3oNURKT0bDTdPhujfeBbANCmQIf W9m7effMCCdLJ7HS/rPiuLzz4XSase8hfVm+aQLX+cXxLp7sHDqHplzR8rdlVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696906170; a=rsa-sha256; cv=none; b=l+kgg+nLTd/jC2Xl0CkSoiMR07WQnBa+bge3C6zs2BQKrNapRZ0k/DrJMkT15BH1h5/orK NXy9O/TaqDLqUjNMmuxNqycWHf8bha1T2vAQHi1HS3HGo12jkYD0PLB+dhGmrCC+cZjXNo OVFZOxAELqa4nwjSAQUF54TJrx0UvQMO/EUSnrHFObx/4PMnR0OkW0UvKH9LrteBqt4wdz 7o827zH2t4dEWSwyF5z1tcwO83iTJGrOJDSYqnvvhwbpF+zYf6+SFm0/huhPSEmdIH52KN 3iMJ37THIDEjoUqIfgwmmseC8cScVeSKoCHYAUl8Be6kDNXeCxkBPEG1K/XP5Q== 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=1696906170; 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=DU2r+q869nDnMjlS80UWCCOwgSzD4WIbViYGalYTUSY=; b=HCTZnKz93w0w9tSjcG0rb+gNY2TMJPc4jZkXwJcrgXZoRCdZKq9QGGwqnUdC9gfTVDKW8y ugEgpCKjKqiv0rjbwu2j7BgNFJmvR4c0RPEX0vlnsLmOx+Nn1SXdYOuF7qq0g0KaKfrGNJ KZM19zzpmf1u3S/sHgoWuiGXeZ4fQSHy++iA/wQf3pvlJqDmWncEVp+C2g8KaSoKs2c2mH vmsirJ6dayslh+qaxKl1l7Bh4xi/r2xycXDTKRGO8/sdmxzfrASmfxc2WFmddANq3eMlbt ERxYppR/Fp4vthJS8mwzJCs8Cd+BhcyGwML+7FAQIPt9zzeYP6tPRdE4Bhp8Ag== 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 4S4L2y4Jymz5xv; Tue, 10 Oct 2023 02:49:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39A2nUbh019592; Tue, 10 Oct 2023 02:49:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39A2nUOK019589; Tue, 10 Oct 2023 02:49:30 GMT (envelope-from git) Date: Tue, 10 Oct 2023 02:49:30 GMT Message-Id: <202310100249.39A2nUOK019589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 75be7e30271b - main - sysctl: emit a newline after NULL node descriptions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75be7e30271bb192fd27698982f2c7e56831eeef Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=75be7e30271bb192fd27698982f2c7e56831eeef commit 75be7e30271bb192fd27698982f2c7e56831eeef Author: Ed Maste AuthorDate: 2023-10-06 18:00:30 +0000 Commit: Ed Maste CommitDate: 2023-10-10 02:48:53 +0000 sysctl: emit a newline after NULL node descriptions Previously when printing the sysctl description (via the -d flag) we omitted the newline if the node provided no description (i.e., NULL). This could be observed via e.g. `sysctl -d dev`. PR: 44034 Reviewed by: zlei Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42112 --- sbin/sysctl/sysctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index fe1a53a9d645..7ed7be95c9a5 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -998,8 +998,10 @@ show_info(char *name, const char *sep, int ctltype, char *fmt, int *qoid, int nl bzero(buf, BUFSIZ); j = sizeof(buf); i = sysctl(qoid, nlen + 2, buf, &j, 0, 0); - if (i < 0) + if (i < 0) { + putchar('\n'); return (1); + } fputs(buf, stdout); return (error); }