diff --git a/liblvm/lvm.h b/liblvm/lvm.h index 5805546c2..6e337b9d8 100644 --- a/liblvm/lvm.h +++ b/liblvm/lvm.h @@ -110,8 +110,7 @@ const char *lvm_errmsg(lvm_t libh); * \param libh * Handle obtained from lvm_create. * - * \return A VG handle with error code set appropriately. - * FIXME: Update error handling description after errno and logging patches + * \return non-NULL vg handle (success) or NULL (failure) */ vg_t *lvm_vg_create(lvm_t libh, const char *vg_name); diff --git a/liblvm/lvm_vg.c b/liblvm/lvm_vg.c index b8348757f..99e0bbcc8 100644 --- a/liblvm/lvm_vg.c +++ b/liblvm/lvm_vg.c @@ -24,7 +24,15 @@ vg_t *lvm_vg_create(lvm_t libh, const char *vg_name) { - return vg_create((struct cmd_context *)libh, vg_name); + vg_t *vg; + + vg = vg_create((struct cmd_context *)libh, vg_name); + /* FIXME: error handling is still TBD */ + if (vg_read_error(vg)) { + vg_release(vg); + return NULL; + } + return vg; } int lvm_vg_extend(vg_t *vg, const char *device)