summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-03 20:37:08 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-03 20:39:53 +1100
commit6614f847e06551b08f59106352df02c5d13ff23a (patch)
tree490ef6642c4ed6a1f72012b3f0096d736ddbb1c7 /source4/lib/ldb
parent598b565980a02a8909e3738c17fc503f83efe45e (diff)
downloadsamba-6614f847e06551b08f59106352df02c5d13ff23a.tar.gz
samba-6614f847e06551b08f59106352df02c5d13ff23a.tar.bz2
samba-6614f847e06551b08f59106352df02c5d13ff23a.zip
s4-ldb: fixed sorting of module names
this should also fix a valgrind error on freebsd thanks to Matthieu for spotting this
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 121890771d..1457298798 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -906,6 +906,11 @@ static int ldb_modules_load_one(const char *path, const char *version)
return ret;
}
+static int qsort_string(const char **s1, const char **s2)
+{
+ return strcmp(*s1, *s2);
+}
+
/*
load all modules from the given ldb modules directory. This is run once
@@ -961,7 +966,7 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version)
closedir(dir);
/* sort the directory, so we get consistent load ordering */
- qsort(modlist, num_modules, sizeof(modlist[0]), QSORT_CAST strcmp);
+ TYPESAFE_QSORT(modlist, num_modules, qsort_string);
for (i=0; i<num_modules; i++) {
int ret = ldb_modules_load_one(modlist[i], version);