1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

Return PERCENT_INVALID for error case

If the percent value could not be determined return PERCENT_INVALID.
Indent function with tabs.
This commit is contained in:
Zdenek Kabelac 2011-01-05 12:33:51 +00:00
parent a5d006d515
commit 1936d75b3c
2 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.80 -
====================================
Return defined value for errors in _copy_percent() and _snap_percent().
Correct return code of cmirrord when issuing 'start' when already running.
Fix wrongly paired unlocking of global lock in pvchange. (2.02.66)
Add backtraces for backup and backup_remove fail paths.

View File

@ -87,15 +87,18 @@ static int _not_implemented_set(void *obj, struct lvm_property_type *prop)
}
static percent_t _copy_percent(const struct logical_volume *lv) {
percent_t perc;
lv_mirror_percent(lv->vg->cmd, (struct logical_volume *) lv, 0, &perc, NULL);
return perc;
percent_t perc;
if (!lv_mirror_percent(lv->vg->cmd, (struct logical_volume *) lv,
0, &perc, NULL))
perc = PERCENT_INVALID;
return perc;
}
static percent_t _snap_percent(const struct logical_volume *lv) {
percent_t perc;
lv_snapshot_percent(lv, &perc);
return perc;
percent_t perc;
if (!lv_snapshot_percent(lv, &perc))
perc = PERCENT_INVALID;
return perc;
}
/* PV */