1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-25 21:57:45 +03:00

Remove dead assignment of 'ret' value

Variable 'ret' assigned from _do_event() was actually not used and replaced with next
assignment without any read of the returned value.

Code is reformated - so the error path is put in the if() branch and normal
code is put after the 'if' together with FIXME comment.


FIXME lowprio: logging needs to be fixed in this code,
 - multiple log_errors are printed, stacks are missing...
This commit is contained in:
Zdenek Kabelac 2011-01-06 10:45:41 +00:00
parent 4b1232984b
commit 0a9b444a60

View File

@ -715,17 +715,18 @@ int dm_event_get_registered_device(struct dm_event_handler *dmevh, int next)
uuid = dm_task_get_uuid(dmt);
if (!(ret = _do_event(next ? DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE :
DM_EVENT_CMD_GET_REGISTERED_DEVICE, dmevh->dmeventd_path,
&msg, dmevh->dso, uuid, dmevh->mask, 0))) {
/* FIXME this will probably horribly break if we get
ill-formatted reply */
ret = _parse_message(&msg, &reply_dso, &reply_uuid, &reply_mask);
} else {
if (_do_event(next ? DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE :
DM_EVENT_CMD_GET_REGISTERED_DEVICE, dmevh->dmeventd_path,
&msg, dmevh->dso, uuid, dmevh->mask, 0)) {
ret = -ENOENT;
stack;
goto fail;
}
/* FIXME this will probably horribly break if we get
ill-formatted reply */
ret = _parse_message(&msg, &reply_dso, &reply_uuid, &reply_mask);
dm_task_destroy(dmt);
dmt = NULL;