1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00

Add missing error path tests

This commit is contained in:
Zdenek Kabelac 2011-01-05 14:03:36 +00:00
parent de0ae6a18f
commit 006e5fa0ea
2 changed files with 12 additions and 8 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.80 -
====================================
Add missing tests in _setup_task().
Fail poll daemon creation when lvmcache_init() fails.
Return defined value for errors in _copy_percent() and _snap_percent().
Correct return code of cmirrord when issuing 'start' when already running.

View File

@ -75,19 +75,22 @@ static struct dm_task *_setup_task(const char *name, const char *uuid,
if (!(dmt = dm_task_create(task)))
return_NULL;
if (name)
dm_task_set_name(dmt, name);
if (name && !dm_task_set_name(dmt, name))
goto_out;
if (uuid && *uuid)
dm_task_set_uuid(dmt, uuid);
if (uuid && *uuid && !dm_task_set_uuid(dmt, uuid))
goto_out;
if (event_nr)
dm_task_set_event_nr(dmt, *event_nr);
if (event_nr && !dm_task_set_event_nr(dmt, *event_nr))
goto_out;
if (major)
dm_task_set_major_minor(dmt, major, minor, 1);
if (major && !dm_task_set_major_minor(dmt, major, minor, 1))
goto_out;
return dmt;
out:
dm_task_destroy(dmt);
return NULL;
}
static int _info_run(const char *name, const char *dlid, struct dm_info *info,