Corrected sequence of IsoNode xinfo list after cloning.

This commit is contained in:
Thomas Schmitt 2011-02-21 12:35:50 +01:00
parent 16863755be
commit 1f24b39879

View File

@ -262,6 +262,21 @@ int iso_node_remove_all_xinfo(IsoNode *node, int flag)
return ISO_SUCCESS; return ISO_SUCCESS;
} }
static
int iso_node_revert_xinfo_list(IsoNode *node, int flag)
{
IsoExtendedInfo *pos, *next, *prev = NULL;
for (pos = node->xinfo; pos != NULL; pos = next) {
next = pos->next;
pos->next = prev;
prev = pos;
}
node->xinfo = prev;
return ISO_SUCCESS;
}
int iso_node_clone_xinfo(IsoNode *from_node, IsoNode *to_node, int flag) int iso_node_clone_xinfo(IsoNode *from_node, IsoNode *to_node, int flag)
{ {
void *handle = NULL, *data, *new_data; void *handle = NULL, *data, *new_data;
@ -288,13 +303,10 @@ int iso_node_clone_xinfo(IsoNode *from_node, IsoNode *to_node, int flag)
} }
if (ret < 0) { if (ret < 0) {
iso_node_remove_all_xinfo(to_node, 0); iso_node_remove_all_xinfo(to_node, 0);
return ret;
} else { } else {
ret = iso_node_revert_xinfo_list(to_node, 0);
/* >>> revert order of xinfo list */;
} }
return ISO_SUCCESS; return ret;
} }
/** /**