svn commit: r337405 - projects/bectl/sbin/bectl
Kyle Evans
kevans at FreeBSD.org
Tue Aug 7 03:01:05 UTC 2018
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 {
More information about the svn-src-projects
mailing list