From nobody Fri Oct 13 15:44:18 2023 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 4S6W5Z4n2Wz4x90d; Fri, 13 Oct 2023 15:44:18 +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 4S6W5Z1gkTz3XZL; Fri, 13 Oct 2023 15:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697211858; 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=tpQMBj28WmDPyVk97NaY58uy8w130kSWqjrgX3gjq64=; b=RxUHLaD4/r9XY5Sy2UGysuc2YS0bdVa2fcVUIs4/0RnwDJhUjkVy+oZTkS4UqT+abDnCur UnXNPEBHfjLL7YbGddgQmB0Vy7+dPwjZ/uUCkvFK2lo4/qIyaUCh5j6HXt49XkOhVfslwT uEOjkiWxt6V0Ht2Kmyf6AlfpRuyaxtBSy1Tcjugk0foDDYwQDGCWo1t6NhZEfHrDTfvkPY 1TPVBfs6wo6aLO+MoJ3hw2sFEOa2kUomneumrgaLAJPibdFhFHSGF7LOwNzyVHp0GPnki/ WIeuMoz8VHgtEliIUb2xW46oy1B4RAjZkuYj9XTUNcEg6O61gExJ1PiXKR6ZMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697211858; a=rsa-sha256; cv=none; b=xYApGW1Kx6RXOZqp8eMmYLHR8XQymuEuWPvpwpNqgXtbTPWPdgAgejYOwUgMqMrE4odOMr 3l65jAL6Mj2grJSBOZetQO8ydZhsbcD1FSzxmXdsgJxSZJjyz5aulGwQ/kCg1JvSBDqagM YqkkdGsKABCL8p0KhPZUAQP7kMDPo+C+3uYS/pJj5Jji4LXYYjE+WUl7add0cG0B1NC18z hltZ8Lf5Hx5b38NDH5zvnr/NSKU0sUwj109go0VEEYlWSYTqqb10jPKOw1iWrq9K8BnL8b 7NNW1/mMtWyBOhF6N9ydeViBw4QimVhCeM8hfpaRyrFfc3C8z2FFLU9rqCDHAg== 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=1697211858; 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=tpQMBj28WmDPyVk97NaY58uy8w130kSWqjrgX3gjq64=; b=BDDpZxIjCfDSQyCw5NryMJEzkSnvDfIEOBvco5JFDoXn9kbMbdkMFtZR2M3gXd3MrPI3ao gy3EdIqnoSHQJ15ChHdA7ou8W6ici/ivt02jYxWM2+8ThOSBqTNbTDxVKh5iJRfoE0V83Q 5ttz1O37D3gRoVWkRiqb7fQbobaBhRiWWgoAl8wyle+F6bwc3xGGjCKdCc2NLGSMJyzbkV NDVc4+DYGyBtrorI/29h8UKeQ0p45BMrBsZ8lKk1Ra/9nDzvgFvVVxOaCDX9reL10ZFt71 DEPmtq6PXr9Qor0K6X3hg0rcAuOP9DZ/6ch/cIBh8jc3YDeEv4QIT/gUVn/25w== 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 4S6W5Z0mVSztwb; Fri, 13 Oct 2023 15:44:18 +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 39DFiI4I014828; Fri, 13 Oct 2023 15:44:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DFiIbX014825; Fri, 13 Oct 2023 15:44:18 GMT (envelope-from git) Date: Fri, 13 Oct 2023 15:44:18 GMT Message-Id: <202310131544.39DFiIbX014825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ced9fe051e31 - stable/14 - sysctl: emit a newline after NULL node descriptions 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ced9fe051e31f858a9d1dbec01cf6dec483fab19 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ced9fe051e31f858a9d1dbec01cf6dec483fab19 commit ced9fe051e31f858a9d1dbec01cf6dec483fab19 Author: Ed Maste AuthorDate: 2023-10-06 18:00:30 +0000 Commit: Ed Maste CommitDate: 2023-10-13 14:12:34 +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 (cherry picked from commit 75be7e30271bb192fd27698982f2c7e56831eeef) --- 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); }