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/transaction.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/transaction.c')
-rw-r--r-- | lib/tdb/common/transaction.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index a2498ec82d..81cfd16942 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -195,7 +195,7 @@ static int transaction_read(struct tdb_context *tdb, tdb_off_t off, void *buf, return 0; fail: - TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_read: failed at off=%d len=%d\n", off, len)); + TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_read: failed at off=%u len=%u\n", off, len)); tdb->ecode = TDB_ERR_IO; tdb->transaction->transaction_error = 1; return -1; @@ -303,7 +303,7 @@ static int transaction_write(struct tdb_context *tdb, tdb_off_t off, return 0; fail: - TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_write: failed at off=%d len=%d\n", + TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_write: failed at off=%u len=%u\n", (blk*tdb->transaction->block_size) + off, len)); tdb->transaction->transaction_error = 1; return -1; @@ -1217,7 +1217,7 @@ int tdb_transaction_recover(struct tdb_context *tdb) if (tdb->methods->tdb_write(tdb, ofs, p+8, len) == -1) { free(data); - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to recover %d bytes at offset %d\n", len, ofs)); + TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to recover %u bytes at offset %u\n", len, ofs)); tdb->ecode = TDB_ERR_IO; return -1; } @@ -1255,7 +1255,7 @@ int tdb_transaction_recover(struct tdb_context *tdb) return -1; } - TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_recover: recovered %d byte database\n", + TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_recover: recovered %u byte database\n", recovery_eof)); /* all done */ |