Fix printf attributes.

This commit is contained in:
Andreas Schneider 2008-06-27 18:52:09 +02:00
parent d968e6f48d
commit bd8034170a
5 changed files with 12 additions and 10 deletions

View file

@ -211,8 +211,9 @@ int csync_init(CSYNC *ctx) {
/* create/load journal */
if (! csync_is_journal_disabled(ctx)) {
if (asprintf(&ctx->journal.file, "%s/csync_journal_%llu.db", ctx->options.config_dir,
c_jhash64((uint8_t *) ctx->remote.uri, strlen(ctx->remote.uri), 0)) < 0) {
uint64_t h = c_jhash64((uint8_t *) ctx->remote.uri, strlen(ctx->remote.uri), 0);
if (asprintf(&ctx->journal.file, "%s/csync_journal_%llu.db",
ctx->options.config_dir, (long long unsigned int) h) < 0) {
rc = -1;
goto out;
}
@ -473,7 +474,7 @@ int csync_destroy(CSYNC *ctx) {
jwritten = 1;
clock_gettime(CLOCK_REALTIME, &finish);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
"Writing the journal of %llu files to disk took %.2f seconds",
"Writing the journal of %lu files to disk took %.2f seconds",
c_rbtree_size(ctx->local.tree), c_secdiff(finish, start));
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Unable to write journal: %s",

View file

@ -432,7 +432,7 @@ c_strlist_t *csync_journal_query(CSYNC *ctx, const char *statement) {
if (busy_count) {
/* sleep 100 msec */
usleep(100000);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "sqlite3_prepare: BUSY counter: %d", busy_count);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "sqlite3_prepare: BUSY counter: %zu", busy_count);
}
err = sqlite3_prepare(ctx->journal.db, statement, -1, &stmt, &tail);
} while (err == SQLITE_BUSY && busy_count ++ < 120);
@ -458,7 +458,7 @@ c_strlist_t *csync_journal_query(CSYNC *ctx, const char *statement) {
}
/* sleep 100 msec */
usleep(100000);
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "sqlite3_step: BUSY counter: %d", busy_count);
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "sqlite3_step: BUSY counter: %zu", busy_count);
continue;
}

View file

@ -184,7 +184,7 @@ static int _csync_push_file(CSYNC *ctx, csync_file_stat_t *st) {
if (bwritten < 0 || bread != bwritten) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR,
"file: %s, command: write, error: bread = %d, bwritten = %d - %s",
"file: %s, command: write, error: bread = %zu, bwritten = %zu - %s",
duri, bread, bwritten, strerror(errno));
rc = 1;
goto out;
@ -224,7 +224,7 @@ static int _csync_push_file(CSYNC *ctx, csync_file_stat_t *st) {
}
if (st->size != tstat->size) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "file: %s, error: incorrect filesize (size: %d should be %d)", turi, tstat->size, st->size);
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "file: %s, error: incorrect filesize (size: %zu should be %zu)", turi, tstat->size, st->size);
rc = 1;
goto out;
}

View file

@ -81,8 +81,8 @@ static int _csync_detect_update(CSYNC *ctx, const char *file, const csync_vio_fi
if (st == NULL) {
return -1;
}
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s - hash %llu, st size: %d",
path, h, size);
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s - hash %llu, st size: %zu",
path, (long long unsigned int) h, size);
/* check hardlink count */
if (type == CSYNC_FTW_TYPE_FILE && fs->nlink > 1) {

View file

@ -47,7 +47,8 @@ END_TEST
START_TEST (log_null)
{
CSYNC_LOG(CSYNC_LOG_PRIORITY_UNKNOWN, "log %s", NULL);
char *z = NULL;
CSYNC_LOG(CSYNC_LOG_PRIORITY_UNKNOWN, "log %s", z);
}
END_TEST