summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-03-14 13:37:51 +1030
committerRusty Russell <rusty@rustcorp.com.au>2012-03-14 05:09:30 +0100
commit5ba2e4fc391e3f894b9d939b9ae65f664e32bb0c (patch)
tree92e02b25990bbd474811a25cdcdaadd611c372af
parentee0d1daa279049a1b38b1ef4b3a1b29b1344b212 (diff)
downloadsamba-5ba2e4fc391e3f894b9d939b9ae65f664e32bb0c.tar.gz
samba-5ba2e4fc391e3f894b9d939b9ae65f664e32bb0c.tar.bz2
samba-5ba2e4fc391e3f894b9d939b9ae65f664e32bb0c.zip
lib/tdb2: fix error string formatting.
This caused a crash on PPC64 when we failed the mmap (found by failtest, reported by Amitay) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--lib/tdb2/io.c4
-rw-r--r--lib/tdb2/tdb1_check.c3
-rw-r--r--lib/tdb2/tdb1_io.c5
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/tdb2/io.c b/lib/tdb2/io.c
index b4a6f0beae..5634922db3 100644
--- a/lib/tdb2/io.c
+++ b/lib/tdb2/io.c
@@ -134,8 +134,8 @@ static enum TDB_ERROR tdb_oob(struct tdb_context *tdb,
return TDB_SUCCESS;
tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR,
- "tdb_oob len %llu beyond eof at %zu",
- (long long)(off + len), st.st_size);
+ "tdb_oob len %llu beyond eof at %llu",
+ (long long)(off + len), (long long)st.st_size);
return TDB_ERR_IO;
}
diff --git a/lib/tdb2/tdb1_check.c b/lib/tdb2/tdb1_check.c
index a8e54b2ee0..68f8f8183c 100644
--- a/lib/tdb2/tdb1_check.c
+++ b/lib/tdb2/tdb1_check.c
@@ -420,7 +420,8 @@ int tdb1_check(struct tdb_context *tdb,
tdb_logerr(tdb, TDB_SUCCESS, TDB_LOG_WARNING,
"Dead space at %d-%d (of %u)\n",
- off, off + dead, tdb->file->map_size);
+ off, off + dead,
+ (unsigned)tdb->file->map_size);
rec.rec_len = dead - sizeof(rec);
break;
case TDB1_RECOVERY_MAGIC:
diff --git a/lib/tdb2/tdb1_io.c b/lib/tdb2/tdb1_io.c
index f3d139d043..e7d20b8cfc 100644
--- a/lib/tdb2/tdb1_io.c
+++ b/lib/tdb2/tdb1_io.c
@@ -230,8 +230,9 @@ void tdb1_mmap(struct tdb_context *tdb)
if (tdb->file->map_ptr == MAP_FAILED) {
tdb->file->map_ptr = NULL;
tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_WARNING,
- "tdb1_mmap failed for size %d (%s)",
- tdb->file->map_size, strerror(errno));
+ "tdb1_mmap failed for size %llu (%s)",
+ (long long)tdb->file->map_size,
+ strerror(errno));
}
} else {
tdb->file->map_ptr = NULL;