summaryrefslogtreecommitdiffstats
path: root/common/collection/collection.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-07-10 11:43:05 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-07-15 11:19:46 -0400
commit9689454cb2d3d3b3c9e02a32ab9db13f49e8d5a2 (patch)
tree8247496c0ca89532944b069467e67c875712e123 /common/collection/collection.h
parent1a91062d7d82407a6e376b62b29dca709170a66b (diff)
downloadsssd-9689454cb2d3d3b3c9e02a32ab9db13f49e8d5a2.tar.gz
sssd-9689454cb2d3d3b3c9e02a32ab9db13f49e8d5a2.tar.xz
sssd-9689454cb2d3d3b3c9e02a32ab9db13f49e8d5a2.zip
COLLECTION Fixed: iterator_up and insert_into_current
During a review of the previous patch the two issues were found: a) The col_iterator_up function was not implemented properly so it got reworked. New implementation changes the way error condition is handled. Comments were updated accordingly. b) There was a mising check for validity of the argument in the col_insert_into_current function. Check was added. c) Unit test modified to reflect the change in functionality.
Diffstat (limited to 'common/collection/collection.h')
-rw-r--r--common/collection/collection.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/collection/collection.h b/common/collection/collection.h
index 7de17d2e2..5483c1381 100644
--- a/common/collection/collection.h
+++ b/common/collection/collection.h
@@ -544,9 +544,11 @@ int col_iterate_collection(struct collection_iterator *iterator,
* collection 'level' levels up.
* The 'Level' parameter indicates how many levels up you want to jump.
* If 0 - call is a no op.
- * If the depth is less than requested level function will return error EINVAL.
+ * If the depth is less then requested level the iterator will
+ * get to the 0 level and next call to col_iterate_collection
+ * will return NULL item.
*/
-int col_iterate_up(struct collection_iterator *iterator, int level);
+int col_iterate_up(struct collection_iterator *iterator, unsigned level);
/* How deep are we relative to the top level.
* This function might report depth that might look misleading.