@@ -841,8 +841,8 @@ ha_sharded_cluster_add_replica_set (ha_sharded_cluster_t *cluster,
841841{
842842 int i ;
843843
844- bson_return_if_fail (cluster );
845- bson_return_if_fail (replica_set );
844+ BSON_ASSERT (cluster );
845+ BSON_ASSERT (replica_set );
846846
847847 for (i = 0 ; i < 12 ; i ++ ) {
848848 if (!cluster -> replicas [i ]) {
@@ -860,7 +860,7 @@ ha_sharded_cluster_add_config (ha_sharded_cluster_t *cluster,
860860 ha_node_t * node ;
861861 char dbpath [PATH_MAX ];
862862
863- bson_return_val_if_fail (cluster , NULL );
863+ BSON_ASSERT (cluster );
864864
865865 bson_snprintf (dbpath , sizeof dbpath , "%s/%s" , cluster -> name , name );
866866 dbpath [sizeof dbpath - 1 ] = '\0' ;
@@ -889,7 +889,7 @@ ha_sharded_cluster_add_router (ha_sharded_cluster_t *cluster,
889889 ha_node_t * node ;
890890 char dbpath [PATH_MAX ];
891891
892- bson_return_val_if_fail (cluster , NULL );
892+ BSON_ASSERT (cluster );
893893
894894 bson_snprintf (dbpath , sizeof dbpath , "%s/%s" , cluster -> name , name );
895895 dbpath [sizeof dbpath - 1 ] = '\0' ;
@@ -972,7 +972,7 @@ ha_sharded_cluster_start (ha_sharded_cluster_t *cluster)
972972 ha_node_t * iter ;
973973 int i ;
974974
975- bson_return_if_fail (cluster );
975+ BSON_ASSERT (cluster );
976976
977977 if (!stat (cluster -> name , & st )) {
978978 if (S_ISDIR (st .st_mode )) {
@@ -1024,7 +1024,7 @@ ha_sharded_cluster_wait_for_healthy (ha_sharded_cluster_t *cluster)
10241024{
10251025 int i ;
10261026
1027- bson_return_if_fail (cluster );
1027+ BSON_ASSERT (cluster );
10281028
10291029 for (i = 0 ; i < 12 ; i ++ ) {
10301030 if (cluster -> replicas [i ]) {
@@ -1040,7 +1040,7 @@ ha_sharded_cluster_shutdown (ha_sharded_cluster_t *cluster)
10401040 ha_node_t * iter ;
10411041 int i ;
10421042
1043- bson_return_if_fail (cluster );
1043+ BSON_ASSERT (cluster );
10441044
10451045 for (i = 0 ; i < 12 ; i ++ ) {
10461046 if (cluster -> replicas [i ]) {
0 commit comments