summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/open.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-20 08:06:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:29 -0500
commit118c064a473562274bff8fb47f37437db904b8fb (patch)
tree669454db50418bb1d07ec5b1520bae6aecf9c941 /source4/lib/tdb/common/open.c
parent5370afe8c2d9f4b77711010f2ce9ea4fc33886c4 (diff)
downloadsamba-118c064a473562274bff8fb47f37437db904b8fb.tar.gz
samba-118c064a473562274bff8fb47f37437db904b8fb.tar.bz2
samba-118c064a473562274bff8fb47f37437db904b8fb.zip
r19423: merge some tdb changes from SAMBA_3_0 to SAMBA_4_0
this is in preparation of a merge in the other direction (This used to be commit db3211079fd594aa03c3b9bb3eb6ad86bdd32837)
Diffstat (limited to 'source4/lib/tdb/common/open.c')
-rw-r--r--source4/lib/tdb/common/open.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/lib/tdb/common/open.c b/source4/lib/tdb/common/open.c
index 29ce1242cc..e1f21aa856 100644
--- a/source4/lib/tdb/common/open.c
+++ b/source4/lib/tdb/common/open.c
@@ -54,7 +54,7 @@ static int tdb_new_database(struct tdb_context *tdb, int hash_size)
/* We make it up in memory, then write it out if not internal */
size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off_t);
- if (!(newdb = calloc(size, 1)))
+ if (!(newdb = (struct tdb_header *)calloc(size, 1)))
return TDB_ERRCODE(TDB_ERR_OOM, -1);
/* Fill in the header */
@@ -140,7 +140,7 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
unsigned char *vp;
u32 vertest;
- if (!(tdb = calloc(1, sizeof *tdb))) {
+ if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) {
/* Can't log this */
errno = ENOMEM;
goto fail;
@@ -263,7 +263,8 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
tdb->map_size = st.st_size;
tdb->device = st.st_dev;
tdb->inode = st.st_ino;
- tdb->locked = calloc(tdb->header.hash_size+1, sizeof(tdb->locked[0]));
+ tdb->locked = (struct tdb_lock_type *)calloc(tdb->header.hash_size+1,
+ sizeof(tdb->locked[0]));
if (!tdb->locked) {
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: "
"failed to allocate lock structure for %s\n",