diff options
author | David Teigland <teigland@redhat.com> | 2018-06-15 14:14:39 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2018-06-15 14:14:39 -0500 |
commit | ccab4a1994f4218810f1a6152cf6c71caa00977e (patch) | |
tree | 2d4eb391986218c4618af76ab4c4f5ddb287bf55 /lib/report | |
parent | 328303d4d45b4e9480cc806ef84e843e2176f584 (diff) | |
download | lvm2-ccab4a1994f4218810f1a6152cf6c71caa00977e.tar.gz |
report: show empty lock_type for none
Sometimes lock_type would be displayed as "none"
(after changing it) and sometimes as empty.
Make it consistently empty.
Diffstat (limited to 'lib/report')
-rw-r--r-- | lib/report/report.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/report/report.c b/lib/report/report.c index 803982012..369f47c8a 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -2855,8 +2855,14 @@ static int _vglocktype_disp(struct dm_report *rh, struct dm_pool *mem, const void *data, void *private) { const struct volume_group *vg = (const struct volume_group *) data; + const char *locktype; - return _field_string(rh, field, vg->lock_type ? : ""); + if (!vg->lock_type || !strcmp(vg->lock_type, "none")) + locktype = ""; + else + locktype = vg->lock_type; + + return _field_string(rh, field, locktype); } static int _vglockargs_disp(struct dm_report *rh, struct dm_pool *mem, |