Date: Tue, 7 Aug 2018 03:01:04 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337405 - projects/bectl/sbin/bectl Message-ID: <201808070301.w77314Ww003353@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Tue Aug 7 03:01:04 2018 New Revision: 337405 URL: https://svnweb.freebsd.org/changeset/base/337405 Log: bectl(8): Only show mountpoint if the dataset is actually mounted This is to accomodate a later change in libbe(3) that will always return the mountpoint, whether it be the directory the dataset is actively mounted at or the "mountpoint" property. Modified: projects/bectl/sbin/bectl/bectl_list.c Modified: projects/bectl/sbin/bectl/bectl_list.c ============================================================================== --- projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 02:40:00 2018 (r337404) +++ projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 03:01:04 2018 (r337405) @@ -175,7 +175,7 @@ print_info(const char *name, nvlist_t *dsprops, struct const char *oname; char *dsname, *propstr; int active_colsz; - boolean_t active_now, active_reboot; + boolean_t active_now, active_reboot, mounted; dsname = NULL; originprops = NULL; @@ -228,7 +228,10 @@ print_info(const char *name, nvlist_t *dsprops, struct active_colsz--; } print_padding(NULL, active_colsz, pc); - if (nvlist_lookup_string(dsprops, "mountpoint", &propstr) == 0){ + if (nvlist_lookup_boolean_value(dsprops, "mounted", &mounted) != 0) + mounted = false; + if (mounted && nvlist_lookup_string(dsprops, "mountpoint", + &propstr) == 0) { printf("%s", propstr); print_padding(propstr, pc->mount_colsz, pc); } else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808070301.w77314Ww003353>