diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-05-28 16:53:56 +0930 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-05-28 11:22:14 +0200 |
commit | 3bd686c5ad4756af1033ac14ba09a40156cc6d47 (patch) | |
tree | 55d7d61637fa477e542f2d8c291835be0f8a415c /lib/tdb/common/freelist.c | |
parent | 5a633dd6bb5be817c6b421df0c098e3428a20773 (diff) | |
download | samba-3bd686c5ad4756af1033ac14ba09a40156cc6d47.tar.gz samba-3bd686c5ad4756af1033ac14ba09a40156cc6d47.tar.bz2 samba-3bd686c5ad4756af1033ac14ba09a40156cc6d47.zip |
tdb: fix logging of offets and lengths.
We can have offsets > 2G, so use unsigned values. Fixes other prints to be
native types rather than casts, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 28 11:22:14 CEST 2013 on sn-devel-104
Diffstat (limited to 'lib/tdb/common/freelist.c')
-rw-r--r-- | lib/tdb/common/freelist.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tdb/common/freelist.c b/lib/tdb/common/freelist.c index 2c58c6918f..ea14dd02ab 100644 --- a/lib/tdb/common/freelist.c +++ b/lib/tdb/common/freelist.c @@ -42,7 +42,7 @@ int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct tdb_record if (rec->magic == TDB_MAGIC) { /* this happens when a app is showdown while deleting a record - we should not completely fail when this happens */ - TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read non-free magic 0x%x at offset=%d - fixing\n", + TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read non-free magic 0x%x at offset=%u - fixing\n", rec->magic, off)); rec->magic = TDB_FREE_MAGIC; if (tdb_rec_write(tdb, off, rec) == -1) @@ -52,7 +52,7 @@ int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct tdb_record if (rec->magic != TDB_FREE_MAGIC) { /* Ensure ecode is set for log fn. */ tdb->ecode = TDB_ERR_CORRUPT; - TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read bad magic 0x%x at offset=%d\n", + TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_rec_free_read bad magic 0x%x at offset=%u\n", rec->magic, off)); return -1; } @@ -79,7 +79,7 @@ static int remove_from_freelist(struct tdb_context *tdb, tdb_off_t off, tdb_off_ last_ptr = i; } tdb->ecode = TDB_ERR_CORRUPT; - TDB_LOG((tdb, TDB_DEBUG_FATAL,"remove_from_freelist: not on list at off=%d\n", off)); + TDB_LOG((tdb, TDB_DEBUG_FATAL,"remove_from_freelist: not on list at off=%u\n", off)); return -1; } #endif @@ -195,7 +195,7 @@ update: if (tdb_ofs_read(tdb, FREELIST_TOP, &rec->next) == -1 || tdb_rec_write(tdb, offset, rec) == -1 || tdb_ofs_write(tdb, FREELIST_TOP, &offset) == -1) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_free record write failed at offset=%d\n", offset)); + TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_free record write failed at offset=%u\n", offset)); goto fail; } |