summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/common/io.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-02 18:56:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:45 -0500
commit769efdf048d80c4081487d555649de0f31738dd1 (patch)
tree538aa4fc93b57c463be8a87345bffed8aadc3a85 /source4/lib/tdb/common/io.c
parent3655b4ba757a1db84063907ba9a2c157aef9bdbb (diff)
downloadsamba-769efdf048d80c4081487d555649de0f31738dd1.tar.gz
samba-769efdf048d80c4081487d555649de0f31738dd1.tar.bz2
samba-769efdf048d80c4081487d555649de0f31738dd1.zip
r22041: merge trivial changes from samba3
metze (This used to be commit 902a76ca705f07c61f86a9ef1346583ba9d3157d)
Diffstat (limited to 'source4/lib/tdb/common/io.c')
-rw-r--r--source4/lib/tdb/common/io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/lib/tdb/common/io.c b/source4/lib/tdb/common/io.c
index b3d1c56dc4..cd06dbb1e3 100644
--- a/source4/lib/tdb/common/io.c
+++ b/source4/lib/tdb/common/io.c
@@ -124,8 +124,10 @@ static int tdb_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
if (ret != (ssize_t)len) {
/* Ensure ecode is set for log fn. */
tdb->ecode = TDB_ERR_IO;
- TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_read failed at %d len=%d ret=%d (%s) map_size=%d\n",
- off, len, ret, strerror(errno), (int)tdb->map_size));
+ TDB_LOG((tdb, TDB_DEBUG_FATAL,"tdb_read failed at %d "
+ "len=%d ret=%d (%s) map_size=%d\n",
+ (int)off, (int)len, (int)ret, strerror(errno),
+ (int)tdb->map_size));
return TDB_ERRCODE(TDB_ERR_IO, -1);
}
}
@@ -339,7 +341,7 @@ unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len
len = 1;
}
- if (!(buf = malloc(len))) {
+ if (!(buf = (unsigned char *)malloc(len))) {
/* Ensure ecode is set for log fn. */
tdb->ecode = TDB_ERR_OOM;
TDB_LOG((tdb, TDB_DEBUG_ERROR,"tdb_alloc_read malloc failed len=%d (%s)\n",