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

Update lvm_vg_create to use NULL / non-NULL return for the time being.

Some of the error interface is still TBD.  Rather than exporting a lot
of codes, etc, just use a simple pass / fail.  The allows our unit test
to not segfault if trying to create a VG that already exists.
This commit is contained in:
Dave Wysochanski 2009-07-23 01:20:22 +00:00
parent eefacdfa04
commit f6ffb81bf8
2 changed files with 10 additions and 3 deletions

View File

@ -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);

View File

@ -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)