1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

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.
This commit is contained in:
Kyle Evans 2018-08-07 03:01:04 +00:00
parent 5468566e2d
commit 9c65c7fb48
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/bectl/; revision=337405

View File

@ -175,7 +175,7 @@ print_info(const char *name, nvlist_t *dsprops, struct printc *pc)
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 printc *pc)
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 {