]> sourceware.org Git - lvm2.git/commitdiff
report: show empty lock_type for none
authorDavid Teigland <teigland@redhat.com>
Fri, 15 Jun 2018 19:14:39 +0000 (14:14 -0500)
committerDavid Teigland <teigland@redhat.com>
Fri, 15 Jun 2018 19:14:39 +0000 (14:14 -0500)
Sometimes lock_type would be displayed as "none"
(after changing it) and sometimes as empty.
Make it consistently empty.

lib/report/report.c

index 803982012d65b880d9f11efa630d8617b5bfddb9..369f47c8a256fddb3a348b676e77c652dad46ae9 100644 (file)
@@ -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,
This page took 0.043629 seconds and 5 git commands to generate.