From owner-svn-src-stable@freebsd.org Tue Sep 8 07:37:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55D8D3E6569; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blxnk1P35z4NhT; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F78ACB67; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0887bjWk074807; Tue, 8 Sep 2020 07:37:45 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0887bjE8074806; Tue, 8 Sep 2020 07:37:45 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202009080737.0887bjE8074806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Tue, 8 Sep 2020 07:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365448 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: rew X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 365448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 07:37:46 -0000 Author: rew Date: Tue Sep 8 07:37:45 2020 New Revision: 365448 URL: https://svnweb.freebsd.org/changeset/base/365448 Log: MFC r364369: bectl(8): Fix output of 'bectl list' for the 'Mountpoint' column. PR: 241064 Modified: stable/12/sbin/bectl/bectl_list.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl_list.c ============================================================================== --- stable/12/sbin/bectl/bectl_list.c Tue Sep 8 06:19:23 2020 (r365447) +++ stable/12/sbin/bectl/bectl_list.c Tue Sep 8 07:37:45 2020 (r365448) @@ -292,19 +292,23 @@ print_headers(nvlist_t *props, struct printc *pc) nvpair_t *cur; nvlist_t *dsprops; char *propstr; - size_t be_maxcol; + size_t be_maxcol, mount_colsz; if (pc->show_all_datasets || pc->show_snaps) chosen_be_header = HEADER_BEPLUS; else chosen_be_header = HEADER_BE; be_maxcol = strlen(chosen_be_header); + mount_colsz = strlen(HEADER_MOUNT); for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { be_maxcol = MAX(be_maxcol, strlen(nvpair_name(cur))); + nvpair_value_nvlist(cur, &dsprops); + + if (nvlist_lookup_string(dsprops, "mounted", &propstr) == 0) + mount_colsz = MAX(mount_colsz, strlen(propstr)); if (!pc->show_all_datasets && !pc->show_snaps) continue; - nvpair_value_nvlist(cur, &dsprops); if (nvlist_lookup_string(dsprops, "dataset", &propstr) != 0) continue; be_maxcol = MAX(be_maxcol, strlen(propstr) + INDENT_INCREMENT); @@ -316,10 +320,10 @@ print_headers(nvlist_t *props, struct printc *pc) pc->be_colsz = be_maxcol; pc->active_colsz_def = strlen(HEADER_ACTIVE); - pc->mount_colsz = strlen(HEADER_MOUNT); + pc->mount_colsz = mount_colsz; pc->space_colsz = strlen(HEADER_SPACE); - printf("%*s %s %s %s %s\n", -pc->be_colsz, chosen_be_header, - HEADER_ACTIVE, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); + printf("%*s %s %*s %s %s\n", -pc->be_colsz, chosen_be_header, + HEADER_ACTIVE, -pc->mount_colsz, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); /* * All other invocations in which we aren't using the default header