summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-13 12:59:43 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-13 22:36:12 +1100
commit5549190b37a2bfc01f5cbff89da47b7ca4bd84fa (patch)
treebf93d3c120e6c176cee7574f04e866a447c29814 /source4/dsdb/common
parent1373e748aa53fbd3afe4d2377208257d42628d86 (diff)
downloadsamba-5549190b37a2bfc01f5cbff89da47b7ca4bd84fa.tar.gz
samba-5549190b37a2bfc01f5cbff89da47b7ca4bd84fa.tar.bz2
samba-5549190b37a2bfc01f5cbff89da47b7ca4bd84fa.zip
s4-dsdb: use TYPESAFE_QSORT() in dsdb code
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 8de44726fa..a26ffc26f5 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -38,6 +38,7 @@
#include "libcli/auth/libcli_auth.h"
#include "librpc/gen_ndr/ndr_drsblobs.h"
#include "system/locale.h"
+#include "lib/util/tsort.h"
/*
search the sam for the specified attributes in a specific domain, filter on
@@ -3160,7 +3161,7 @@ int dsdb_find_nc_root(struct ldb_context *samdb, TALLOC_CTX *mem_ctx, struct ldb
}
}
- qsort(nc_dns, el->num_values, sizeof(nc_dns[0]), (comparison_fn_t)dsdb_dn_compare_ptrs);
+ TYPESAFE_QSORT(nc_dns, el->num_values, dsdb_dn_compare_ptrs);
for (i=0; i<el->num_values; i++) {
if (ldb_dn_compare_base(nc_dns[i], dn) == 0) {
@@ -3297,9 +3298,7 @@ int dsdb_load_udv_v2(struct ldb_context *samdb, struct ldb_dn *dn, TALLOC_CTX *m
ret = dsdb_load_partition_usn(samdb, dn, &highest_usn, NULL);
if (ret != LDB_SUCCESS) {
/* nothing to add - this can happen after a vampire */
- qsort(*cursors, *count,
- sizeof(struct drsuapi_DsReplicaCursor2),
- (comparison_fn_t)drsuapi_DsReplicaCursor2_compare);
+ TYPESAFE_QSORT(*cursors, *count, drsuapi_DsReplicaCursor2_compare);
return LDB_SUCCESS;
}
@@ -3307,9 +3306,7 @@ int dsdb_load_udv_v2(struct ldb_context *samdb, struct ldb_dn *dn, TALLOC_CTX *m
if (GUID_equal(our_invocation_id, &(*cursors)[i].source_dsa_invocation_id)) {
(*cursors)[i].highest_usn = highest_usn;
(*cursors)[i].last_sync_success = timeval_to_nttime(&now);
- qsort(*cursors, *count,
- sizeof(struct drsuapi_DsReplicaCursor2),
- (comparison_fn_t)drsuapi_DsReplicaCursor2_compare);
+ TYPESAFE_QSORT(*cursors, *count, drsuapi_DsReplicaCursor2_compare);
return LDB_SUCCESS;
}
}
@@ -3324,9 +3321,7 @@ int dsdb_load_udv_v2(struct ldb_context *samdb, struct ldb_dn *dn, TALLOC_CTX *m
(*cursors)[*count].last_sync_success = timeval_to_nttime(&now);
(*count)++;
- qsort(*cursors, *count,
- sizeof(struct drsuapi_DsReplicaCursor2),
- (comparison_fn_t)drsuapi_DsReplicaCursor2_compare);
+ TYPESAFE_QSORT(*cursors, *count, drsuapi_DsReplicaCursor2_compare);
return LDB_SUCCESS;
}