if (restrict_get_process_size(&limit) == 0 &&
set->cache_size > limit) {
- i_warning("auth_cache_size (%luM) is higher than "
+ i_warning("auth_cache_size (%"PRIuUOFF_T"M) is higher than "
"process VSZ limit (%luM)",
- (unsigned long)(set->cache_size/1024/1024),
+ set->cache_size/1024/1024,
(unsigned long)(limit/1024/1024));
}
passdb_cache = auth_cache_new(set->cache_size, set->cache_ttl,
suffix = suffixes[i];
size /= 1024;
}
- str_printfa(str, "%llu %c", (unsigned long long)size, suffix);
+ str_printfa(str, "%"PRIuUOFF_T" %c", size, suffix);
}
static void config_export_time(string_t *str, unsigned int stamp)
static void
add_timing_string(string_t *str, struct timing *timing, const char *name)
{
- str_printfa(str, ", %u %s:%llu/%llu/%llu/%llu",
+ str_printfa(str, ", %u %s:%"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64,
timing_get_count(timing), name,
- (unsigned long long)timing_get_min(timing)/1000,
- (unsigned long long)timing_get_avg(timing)/1000,
- (unsigned long long)timing_get_95th(timing)/1000,
- (unsigned long long)timing_get_max(timing)/1000);
+ timing_get_min(timing)/1000, timing_get_avg(timing)/1000,
+ timing_get_95th(timing)/1000, timing_get_max(timing)/1000);
timing_reset(timing);
}
str_printfa(str, "[%u users", director_total_users_count());
if (director->users_moving_count > 0)
str_printfa(str, ", %u moving", director->users_moving_count);
- str_printfa(str, ", %lu req/s",
- (unsigned long)(director->num_requests - prev_requests));
- str_printfa(str, ", %llu+%llu kB/s",
- (unsigned long long)(director->ring_traffic_input - prev_input)/1024,
- (unsigned long long)(director->ring_traffic_output - prev_output)/1024);
+ str_printfa(str, ", %"PRIu64" req/s",
+ director->num_requests - prev_requests);
+ str_printfa(str, ", %"PRIu64"+%"PRIu64" kB/s",
+ (director->ring_traffic_input - prev_input)/1024,
+ (director->ring_traffic_output - prev_output)/1024);
str_append_c(str, ']');
prev_requests = director->num_requests;
printf("header\n");
printf(" - highest uid . = %u\n", hdr->highest_uid);
printf(" - message count = %u\n", hdr->message_count);
- printf(" - vsize ....... = %llu\n", (unsigned long long)hdr->vsize);
+ printf(" - vsize ....... = %"PRIu64"\n", hdr->vsize);
} else if (strcmp(ext->name, "maildir") == 0) {
const struct maildir_index_header *hdr = data;
printf("header\n");
printf(" - sync_mtime . = %s\n", unixdate2str(hdr->sync_mtime));
- printf(" - sync_size .. = %llu\n",
- (unsigned long long)hdr->sync_size);
+ printf(" - sync_size .. = %"PRIu64"\n", hdr->sync_size);
printf(" - dirty_flag . = %d\n", hdr->dirty_flag);
printf(" - mailbox_guid = %s\n",
guid_128_to_string(hdr->mailbox_guid));
const struct mail_index_modseq_header *hdr = data;
printf("header\n");
- printf(" - highest_modseq = %llu\n",
- (unsigned long long)hdr->highest_modseq);
+ printf(" - highest_modseq = %"PRIu64"\n", hdr->highest_modseq);
printf(" - log_seq ...... = %u\n", hdr->log_seq);
printf(" - log_offset ... = %u\n", hdr->log_offset);
} else if (strcmp(ext->name, "fts") == 0) {
printf(" - id ........... = %u\n", rec->id);
printf(" - uid_validity . = %u\n", rec->uid_validity);
printf(" - next_uid ..... = %u\n", rec->next_uid);
- printf(" - highest_modseq = %llu\n",
- (unsigned long long)rec->highest_modseq);
+ printf(" - highest_modseq = %"PRIu64"\n",
+ rec->highest_modseq);
name += rec->name_len;
}
} else if (size == sizeof(uint64_t)) {
uint64_t value;
memcpy(&value, data, sizeof(value));
- str_printfa(str, "%llu ", (unsigned long long)value);
+ str_printfa(str, "%"PRIu64, value);
}
/* fall through */
case MAIL_CACHE_FIELD_VARIABLE_SIZE:
else if (ext[i].record_size == sizeof(uint64_t) &&
ext[i].record_align == sizeof(uint64_t)) {
uint64_t value = *((const uint64_t *)data);
- str_printfa(str, "%10llu", (unsigned long long)value);
+ str_printfa(str, "%10"PRIu64, value);
} else {
str_append(str, " ");
}
printf(" : uidnext = %u\n", lrec->uidnext);
} else if (strcmp(ext[i].name, "vsize") == 0) {
const struct mailbox_index_vsize *vrec = data;
- printf(" : vsize = %llu\n",
- (unsigned long long)vrec->vsize);
+ printf(" : vsize = %"PRIu64"\n", vrec->vsize);
printf(" : highest_uid = %u\n", vrec->highest_uid);
printf(" : message_count = %u\n", vrec->message_count);
}
printf("file seq = %u\n", hdr.file_seq);
printf("prev file = %u/%u\n", hdr.prev_file_seq, hdr.prev_file_offset);
printf("create stamp = %u\n", hdr.create_stamp);
- printf("initial modseq = %llu\n",
- (unsigned long long)hdr.initial_modseq);
+ printf("initial modseq = %"PRIu64"\n", hdr.initial_modseq);
printf("compat flags = %x\n", hdr.compat_flags);
*modseq_r = hdr.initial_modseq;
*version_r = MAIL_TRANSACTION_LOG_HDR_VERSION(&hdr);
uint64_t n64;
memcpy(&n64, n, sizeof(n64));
- printf("%llu", (unsigned long long)n64);
+ printf("%"PRIu64, n64);
break;
}
default:
end = CONST_PTR_OFFSET(data, size);
for (rec = data; rec < end; rec++) {
- printf(" - uid=%u modseq=%llu\n", rec->uid,
- ((unsigned long long)rec->modseq_high32 << 32) |
+ printf(" - uid=%u modseq=%"PRIu64"\n", rec->uid,
+ ((uint64_t)rec->modseq_high32 << 32) |
rec->modseq_low32);
}
break;
uint64_t prev_modseq = *modseq;
mail_transaction_update_modseq(&hdr, data, modseq, version);
if (*modseq > prev_modseq)
- printf(", modseq=%llu", (unsigned long long)*modseq);
+ printf(", modseq=%"PRIu64, *modseq);
printf("\n");
log_record_print(&hdr, data, data_size, modseq);
if (str_to_uint64(line->prev_values[i], &prev_num) == 0 &&
str_to_uint64(line->cur_values[i], &cur_num) == 0) {
- if (i_snprintf(numstr, sizeof(numstr), "%llu",
- (unsigned long long)(cur_num - prev_num)) < 0)
+ if (i_snprintf(numstr, sizeof(numstr), "%"PRIu64,
+ (cur_num - prev_num)) < 0)
i_unreached();
doveadm_print(numstr);
} else if (get_double(line->prev_values[i], &prev_double) == 0 &&
if (ret == 0) {
if (pvt_too_old) {
desync_reason = t_strdup_printf(
- "Private modseq %llu no longer in transaction log "
+ "Private modseq %"PRIu64" no longer in transaction log "
"(highest=%"PRIu64", last_common_uid=%u, nextuid=%u)",
- (unsigned long long)last_common_pvt_modseq,
+ last_common_pvt_modseq,
status.highest_pvt_modseq, last_common_uid,
status.uidnext);
} else {
desync_reason = t_strdup_printf(
- "Modseq %llu no longer in transaction log "
+ "Modseq %"PRIu64" no longer in transaction log "
"(highest=%"PRIu64", last_common_uid=%u, nextuid=%u)",
- (unsigned long long)last_common_modseq,
+ last_common_modseq,
status.highest_modseq, last_common_uid,
status.uidnext);
}
status.uidnext, last_common_uid);
ret = 0;
} else if (status.highest_modseq < last_common_modseq) {
- desync_reason = t_strdup_printf("highest_modseq %llu < %llu",
- (unsigned long long)status.highest_modseq,
- (unsigned long long)last_common_modseq);
+ desync_reason = t_strdup_printf("highest_modseq %"PRIu64" < %"PRIu64,
+ status.highest_modseq, last_common_modseq);
ret = 0;
} else if (status.highest_pvt_modseq < last_common_pvt_modseq) {
- desync_reason = t_strdup_printf("highest_pvt_modseq %llu < %llu",
- (unsigned long long)status.highest_pvt_modseq,
- (unsigned long long)last_common_pvt_modseq);
+ desync_reason = t_strdup_printf("highest_pvt_modseq %"PRIu64" < %"PRIu64,
+ status.highest_pvt_modseq, last_common_pvt_modseq);
ret = 0;
}
}
if (!dsync_brain_has_mailbox_state_changed(brain, &dsync_box)) {
if (brain->debug) {
i_debug("brain %c: Skipping mailbox %s with unchanged state "
- "uidvalidity=%u uidnext=%u highestmodseq=%llu highestpvtmodseq=%llu messages=%u",
+ "uidvalidity=%u uidnext=%u highestmodseq=%"PRIu64" highestpvtmodseq=%"PRIu64" messages=%u",
brain->master_brain ? 'M' : 'S',
guid_128_to_string(dsync_box.mailbox_guid),
dsync_box.uid_validity,
dsync_box.uid_next,
- (unsigned long long)dsync_box.highest_modseq,
- (unsigned long long)dsync_box.highest_pvt_modseq,
+ dsync_box.highest_modseq,
+ dsync_box.highest_pvt_modseq,
dsync_box.messages_count);
}
mailbox_free(&box);
iter = hash_table_iterate_init(brain->mailbox_states);
while (hash_table_iterate(iter, brain->mailbox_states, &guid, &state)) {
- i_debug("brain %c: Mailbox %s state: uidvalidity=%u uid=%u modseq=%llu pvt_modseq=%llu messages=%u changes_during_sync=%d",
+ i_debug("brain %c: Mailbox %s state: uidvalidity=%u uid=%u modseq=%"PRIu64" pvt_modseq=%"PRIu64" messages=%u changes_during_sync=%d",
brain->master_brain ? 'M' : 'S',
guid_128_to_string(guid),
state->last_uidvalidity,
state->last_common_uid,
- (unsigned long long)state->last_common_modseq,
- (unsigned long long)state->last_common_pvt_modseq,
+ state->last_common_modseq,
+ state->last_common_pvt_modseq,
state->last_messages_count,
state->changes_during_sync ? 1 : 0);
}
}
if (set->sync_max_size > 0) {
dsync_serializer_encode_add(encoder, "sync_max_size",
- t_strdup_printf("%llu", (unsigned long long)set->sync_max_size));
+ t_strdup_printf("%"PRIu64, set->sync_max_size));
}
if (set->sync_flags != NULL) {
dsync_serializer_encode_add(encoder, "sync_flags",
importer->local_uid_next, last_common_uid));
} else if (importer->local_initial_highestmodseq < last_common_modseq) {
dsync_import_unexpected_state(importer, t_strdup_printf(
- "local HIGHESTMODSEQ %llu < last common HIGHESTMODSEQ %llu",
- (unsigned long long)importer->local_initial_highestmodseq,
- (unsigned long long)last_common_modseq));
+ "local HIGHESTMODSEQ %"PRIu64" < last common HIGHESTMODSEQ %"PRIu64,
+ importer->local_initial_highestmodseq,
+ last_common_modseq));
} else if (importer->local_initial_highestpvtmodseq < last_common_pvt_modseq) {
dsync_import_unexpected_state(importer, t_strdup_printf(
- "local HIGHESTMODSEQ %llu < last common HIGHESTMODSEQ %llu",
- (unsigned long long)importer->local_initial_highestpvtmodseq,
- (unsigned long long)last_common_pvt_modseq));
+ "local HIGHESTMODSEQ %"PRIu64" < last common HIGHESTMODSEQ %"PRIu64,
+ importer->local_initial_highestpvtmodseq,
+ last_common_pvt_modseq));
}
importer->local_changes = dsync_transaction_log_scan_get_hash(log_scan);
update.min_highest_pvt_modseq = importer->remote_highest_pvt_modseq;
imp_debug(importer, "Finish update: min_next_uid=%u "
- "min_first_recent_uid=%u min_highest_modseq=%llu "
- "min_highest_pvt_modseq=%llu",
+ "min_first_recent_uid=%u min_highest_modseq=%"PRIu64" "
+ "min_highest_pvt_modseq=%"PRIu64,
update.min_next_uid, update.min_first_recent_uid,
- (unsigned long long)update.min_highest_modseq,
- (unsigned long long)update.min_highest_pvt_modseq);
+ update.min_highest_modseq,
+ update.min_highest_pvt_modseq);
if (mailbox_update(importer->box, &update) < 0) {
i_error("Mailbox %s: Update failed: %s",
"* OK [NOMODSEQ] No permanent modsequences");
} else if (!status.no_modseq_tracking) {
client_send_line(client,
- t_strdup_printf("* OK [HIGHESTMODSEQ %llu] Highest",
- (unsigned long long)status.highest_modseq));
+ t_strdup_printf("* OK [HIGHESTMODSEQ %"PRIu64"] Highest",
+ status.highest_modseq));
client->sync_last_full_modseq = status.highest_modseq;
}
str_printfa(str, ", %d.%03d in locks",
lock_wait_msecs/1000, lock_wait_msecs%1000);
}
- str_printfa(str, ", %llu B in + %llu",
- (unsigned long long)stats->bytes_in,
- (unsigned long long)stats->bytes_out);
+ str_printfa(str, ", %"PRIu64" B in + %"PRIu64,
+ stats->bytes_in, stats->bytes_out);
if (buffered_size > 0)
str_printfa(str, "+%"PRIuSIZE_T, buffered_size);
str_append(str, " B out");
STATUS_HIGHESTMODSEQ, &status);
if (ret == 0) {
client_send_line(client, t_strdup_printf(
- "* OK [HIGHESTMODSEQ %llu] Highest",
- (unsigned long long)status.highest_modseq));
+ "* OK [HIGHESTMODSEQ %"PRIu64"] Highest",
+ status.highest_modseq));
}
}
if (ret < 0) {
modseq = mail_get_modseq(mail);
if (ctx->client->highest_fetch_modseq < modseq)
ctx->client->highest_fetch_modseq = modseq;
- str_printfa(ctx->state.cur_str, "MODSEQ (%llu) ",
- (unsigned long long)modseq);
+ str_printfa(ctx->state.cur_str, "MODSEQ (%"PRIu64") ", modseq);
return 1;
}
}
if (ctx->highest_seen_modseq != 0) {
- str_printfa(str, " (MODSEQ %llu)",
- (unsigned long long)ctx->highest_seen_modseq);
+ str_printfa(str, " (MODSEQ %"PRIu64")",
+ ctx->highest_seen_modseq);
}
str_append(str, "\r\n");
o_stream_nsend(ctx->cmd->client->output, str_data(str), str_len(str));
if ((ctx->return_options & SEARCH_RETURN_COUNT) != 0)
str_printfa(str, " COUNT %u", ctx->result_count);
if (ctx->highest_seen_modseq != 0) {
- str_printfa(str, " MODSEQ %llu",
- (unsigned long long)ctx->highest_seen_modseq);
+ str_printfa(str, " MODSEQ %"PRIu64,
+ ctx->highest_seen_modseq);
}
str_append(str, "\r\n");
o_stream_nsend(client->output, str_data(str), str_len(str));
&uids_filter, &expunged_uids)) {
*error_r = t_strdup_printf(
"Couldn't get recently expunged UIDs "
- "(uidnext=%u highest_modseq=%llu)", state->uidnext,
- (unsigned long long)state->highest_modseq);
+ "(uidnext=%u highest_modseq=%"PRIu64")",
+ state->uidnext, state->highest_modseq);
return -1;
}
seq_range_array_iter_init(&iter, &expunged_uids);
return -1;
}
if (status.highest_modseq < state->highest_modseq) {
- *error_r = t_strdup_printf("Mailbox HIGHESTMODSEQ shrank %llu -> %llu",
- (unsigned long long)state->highest_modseq,
- (unsigned long long)status.highest_modseq);
+ *error_r = t_strdup_printf("Mailbox HIGHESTMODSEQ shrank %"PRIu64" -> %"PRIu64,
+ state->highest_modseq,
+ status.highest_modseq);
mailbox_free(&box);
return -1;
}
!client->nonpermanent_modseqs &&
status.highest_modseq != state->highest_modseq) {
client_send_line(client, t_strdup_printf(
- "* OK [HIGHESTMODSEQ %llu] Highest",
- (unsigned long long)status.highest_modseq));
+ "* OK [HIGHESTMODSEQ %"PRIu64"] Highest",
+ status.highest_modseq));
client->sync_last_full_modseq = status.highest_modseq;
}
i_debug("Unhibernation sync: %u expunges, %u new messages, %u flag changes, %"PRIu64" modseq changes",
if ((items->status & STATUS_UNSEEN) != 0)
str_printfa(str, "UNSEEN %u ", status->unseen);
if ((items->status & STATUS_HIGHESTMODSEQ) != 0) {
- str_printfa(str, "HIGHESTMODSEQ %llu ",
- (unsigned long long)status->highest_modseq);
+ str_printfa(str, "HIGHESTMODSEQ %"PRIu64" ",
+ status->highest_modseq);
}
if ((items->metadata & MAILBOX_METADATA_VIRTUAL_SIZE) != 0) {
- str_printfa(str, "X-SIZE %llu ",
- (unsigned long long)result->metadata.virtual_size);
+ str_printfa(str, "X-SIZE %"PRIu64" ",
+ result->metadata.virtual_size);
}
if ((items->metadata & MAILBOX_METADATA_GUID) != 0) {
str_printfa(str, "X-GUID %s ",
sync_cmd->sync->tagline[3] != '[') {
/* modify the tagged reply directly */
sync_cmd->sync->tagline = p_strdup_printf(sync_cmd->pool,
- "OK [HIGHESTMODSEQ %llu] %s",
- (unsigned long long)send_modseq,
- sync_cmd->sync->tagline + 3);
+ "OK [HIGHESTMODSEQ %"PRIu64"] %s",
+ send_modseq, sync_cmd->sync->tagline + 3);
} else {
/* send an untagged OK reply */
client_send_line(client, t_strdup_printf(
- "* OK [HIGHESTMODSEQ %llu] Highest",
- (unsigned long long)send_modseq));
+ "* OK [HIGHESTMODSEQ %"PRIu64"] Highest",
+ send_modseq));
}
if (!ctx->sync_status.sync_delayed_expunges) {
modseq = mail_get_modseq(ctx->mail);
if (ctx->client->highest_fetch_modseq < modseq)
ctx->client->highest_fetch_modseq = modseq;
- str_printfa(str, "MODSEQ (%llu)", (unsigned long long)modseq);
+ str_printfa(str, "MODSEQ (%"PRIu64")", modseq);
}
static int imap_sync_send_flags(struct imap_sync_context *ctx, string_t *str)
if (ctx->ctx.max_rows > 0) {
i_assert(ctx->ctx.row_count < ctx->ctx.max_rows);
- str_printfa(query, " LIMIT %llu",
- (unsigned long long)(ctx->ctx.max_rows - ctx->ctx.row_count));
+ str_printfa(query, " LIMIT %"PRIu64,
+ ctx->ctx.max_rows - ctx->ctx.row_count);
}
*stmt_r = sql_dict_statement_init(dict, str_c(query), ¶ms);
/* we can't do this query in _iterate_init(), because
_set_limit() hasn't been called yet at that point. */
- str_printfa(query, "%c%d\t%llu", DICT_PROTOCOL_CMD_ITERATE, ctx->flags,
- (unsigned long long)ctx->ctx.max_rows);
+ str_printfa(query, "%c%d\t%"PRIu64, DICT_PROTOCOL_CMD_ITERATE,
+ ctx->flags, ctx->ctx.max_rows);
for (i = 0; ctx->paths[i] != NULL; i++) {
str_append_c(query, '\t');
str_append(query, str_tabescape(ctx->paths[i]));
if (orig_num < min_value) {
mail_index_sync_set_corrupted(ctx,
"Extension record inc drops number below zero "
- "(uid=%u, diff=%d, orig=%llu)",
- u->uid, u->diff, (unsigned long long)orig_num);
+ "(uid=%u, diff=%d, orig=%"PRIu64")",
+ u->uid, u->diff, orig_num);
return -1;
} else if (orig_num > max_value) {
mail_index_sync_set_corrupted(ctx,
"Extension record inc overflows number "
- "(uid=%u, diff=%d, orig=%llu)",
- u->uid, u->diff, (unsigned long long)orig_num);
+ "(uid=%u, diff=%d, orig=%"PRIu64")",
+ u->uid, u->diff, orig_num);
return -1;
}
return 1;
if (ret <= 0) {
mail_index_set_error(file->log->index,
"Failed to map transaction log %s for getting offset "
- "for modseq=%llu with start_offset=%"PRIuUOFF_T": %s",
- file->filepath, (unsigned long long)modseq,
- *cur_offset, reason);
+ "for modseq=%"PRIu64" with start_offset=%"PRIuUOFF_T": %s",
+ file->filepath, modseq, *cur_offset, reason);
return -1;
}
str_append(dest, "}, \"queries\": {");
for (unsigned int i = 0; i < CASSANDRA_COUNTER_COUNT; i++) {
- str_printfa(dest, "\"%s\": %llu,", counter_names[i],
- (unsigned long long)db->counters[i]);
+ str_printfa(dest, "\"%s\": %"PRIu64",", counter_names[i],
+ db->counters[i]);
}
str_truncate(dest, str_len(dest)-1);
str_append(dest, "}}");
if (!stats_diff_uint64(dest, src1, src2)) {
const uint64_t *n1 = src1, *n2 = src2;
- *error_r = t_strdup_printf("%s %llu < %llu",
- fields[i].name,
- (unsigned long long)*n2,
- (unsigned long long)*n1);
+ *error_r = t_strdup_printf("%s %"PRIu64" < %"PRIu64,
+ fields[i].name, *n2, *n1);
return FALSE;
}
break;
case sizeof(uint64_t): {
const uint64_t *n = ptr;
- str_printfa(str, "%llu", (unsigned long long)*n);
+ str_printfa(str, "%"PRIu64, *n);
break;
}
default:
return -1;
}
- *value_r = p_strdup_printf(imail->mail.data_pool, "GmailId%llx",
- (unsigned long long)num);
+ *value_r = p_strdup_printf(imail->mail.data_pool,
+ "GmailId%"PRIx64, num);
return 0;
case MAIL_FETCH_IMAP_BODY:
if (!IMAPC_BOX_HAS_FEATURE(mbox, IMAPC_FEATURE_FETCH_BODYSTRUCTURE))
}
break;
case SEARCH_SMALLER:
- str_printfa(dest, "SMALLER %llu", (unsigned long long)arg->value.size);
+ str_printfa(dest, "SMALLER %"PRIuUOFF_T, arg->value.size);
break;
case SEARCH_LARGER:
- str_printfa(dest, "LARGER %llu", (unsigned long long)arg->value.size);
+ str_printfa(dest, "LARGER %"PRIuUOFF_T, arg->value.size);
break;
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
}
str_append_c(dest, ' ');
}
- str_printfa(dest, "%llu", (unsigned long long)arg->value.modseq->modseq);
+ str_printfa(dest, "%"PRIu64, arg->value.modseq->modseq);
break;
}
case SEARCH_INTHREAD:
return FALSE;
break;
case SEARCH_MIME_SIZE_EQUAL:
- str_printfa(dest, "SIZE %llu",
- (unsigned long long)arg->value.size);
+ str_printfa(dest, "SIZE %"PRIuUOFF_T, arg->value.size);
break;
case SEARCH_MIME_SIZE_LARGER:
- str_printfa(dest, "SIZE LARGER %llu",
- (unsigned long long)arg->value.size);
+ str_printfa(dest, "SIZE LARGER %"PRIuUOFF_T, arg->value.size);
break;
case SEARCH_MIME_SIZE_SMALLER:
- str_printfa(dest, "SIZE SMALLER %llu",
- (unsigned long long)arg->value.size);
+ str_printfa(dest, "SIZE SMALLER %"PRIuUOFF_T, arg->value.size);
break;
case SEARCH_MIME_DESCRIPTION:
str_append(dest, "DESCRIPTION ");
if (warn && getenv("DEBUG_SILENT") == NULL) {
/* warn after allocation, so if i_debug() wants to
allocate more memory we don't go to infinite loop */
- i_debug("Growing data stack by %"PRIuSIZE_T" as "
+ i_debug("Growing data stack by %zu as "
"'%s' reaches %llu bytes from %u allocations.",
current_block->size,
current_frame_block->marker[frame_pos],
str = t_str_new(128);
str_append(str, "Out of memory");
if (service->vsz_limit != 0) {
- str_printfa(str, " (service %s { vsz_limit=%u MB }, "
+ str_printfa(str, " (service %s { vsz_limit=%"PRIuUOFF_T" MB }, "
"you may need to increase it)",
service->set->name,
- (unsigned int)(service->vsz_limit/1024/1024));
+ service->vsz_limit/1024/1024);
}
if (getenv("CORE_OUTOFMEM") == NULL)
str_append(str, " - set CORE_OUTOFMEM=1 environment to get core dump");
if (ret == QUOTA_GET_RESULT_LIMITED) {
if (i > 0)
str_append_c(str, ' ');
- str_printfa(str, "%s %llu %llu", *list,
- (unsigned long long)value,
- (unsigned long long)limit);
+ str_printfa(str, "%s %"PRIu64" %"PRIu64, *list,
+ value, limit);
i++;
}
}
if (ret_bytes == QUOTA_GET_RESULT_LIMITED ||
ret_bytes == QUOTA_GET_RESULT_UNLIMITED) {
dict_set(trans, DICT_QUOTA_CLONE_BYTES_PATH,
- t_strdup_printf("%llu", (unsigned long long)bytes_value));
+ t_strdup_printf("%"PRIu64, bytes_value));
}
if (ret_count == QUOTA_GET_RESULT_LIMITED ||
ret_count == QUOTA_GET_RESULT_UNLIMITED) {
dict_set(trans, DICT_QUOTA_CLONE_COUNT_PATH,
- t_strdup_printf("%llu", (unsigned long long)count_value));
+ t_strdup_printf("%"PRIu64, count_value));
}
if (dict_transaction_commit(&trans, &error) < 0)
i_error("quota_clone_plugin: Failed to commit dict update: %s", error);
bytes_value_r, bytes_limit_r,
count_value_r, count_limit_r);
if (root->root.quota->set->debug) {
- i_debug("quota-fs: uid=%s, bytes=%llu/%llu files=%llu/%llu",
+ i_debug("quota-fs: uid=%s, bytes=%"PRIu64"/%"PRIu64" "
+ "files=%"PRIu64"/%"PRIu64,
dec2str(root->uid),
- (unsigned long long)*bytes_value_r,
- (unsigned long long)*bytes_limit_r,
- (unsigned long long)*count_value_r,
- (unsigned long long)*count_limit_r);
+ *bytes_value_r, *bytes_limit_r,
+ *count_value_r, *count_limit_r);
}
return 1;
}
bytes_value_r, bytes_limit_r,
count_value_r, count_limit_r);
if (root->root.quota->set->debug) {
- i_debug("quota-fs: gid=%s, bytes=%llu/%llu files=%llu/%llu",
+ i_debug("quota-fs: gid=%s, bytes=%"PRIu64"/%"PRIu64" "
+ "files=%"PRIu64"/%"PRIu64,
dec2str(root->gid),
- (unsigned long long)*bytes_value_r,
- (unsigned long long)*bytes_limit_r,
- (unsigned long long)*count_value_r,
- (unsigned long long)*count_limit_r);
+ *bytes_value_r, *bytes_limit_r,
+ *count_value_r, *count_limit_r);
}
return 1;
}
str = t_str_new(128);
/* if we have no limits, write 0S instead of an empty line */
if (_root->bytes_limit != 0 || _root->count_limit == 0) {
- str_printfa(str, "%lluS",
- (unsigned long long)_root->bytes_limit);
+ str_printfa(str, "%"PRId64"S", _root->bytes_limit);
}
if (_root->count_limit != 0) {
if (str_len(str) > 0)
str_append_c(str, ',');
- str_printfa(str, "%lluC",
- (unsigned long long)_root->count_limit);
+ str_printfa(str, "%"PRIu64"C", _root->count_limit);
}
- str_printfa(str, "\n%llu %llu\n",
- (unsigned long long)root->total_bytes,
- (unsigned long long)root->total_count);
+ str_printfa(str, "\n%"PRIu64" %"PRIu64"\n",
+ root->total_bytes, root->total_count);
if (write_full(fd, str_data(str), str_len(str)) < 0) {
i_error("write_full(%s) failed: %m", str_c(temp_path));
i_close_fd(&fd);
if (root_set->set->debug && root_set->set->initialized) {
i_debug("Quota root %s: Recalculated relative rules with "
- "bytes=%lld count=%lld. Now grace=%llu", root_set->name,
+ "bytes=%lld count=%lld. Now grace=%"PRIu64, root_set->name,
(long long)bytes_limit, (long long)count_limit,
- (unsigned long long)root_set->last_mail_max_extra_bytes);
+ root_set->last_mail_max_extra_bytes);
}
}
root_set->default_rule.bytes_limit,
root_set->default_rule.count_limit);
if (root_set->set->debug) {
- i_debug("Quota warning: bytes=%llu%s "
- "messages=%llu%s reverse=%s command=%s",
- (unsigned long long)warning->rule.bytes_limit,
+ i_debug("Quota warning: bytes=%"PRId64"%s "
+ "messages=%"PRId64"%s reverse=%s command=%s",
+ warning->rule.bytes_limit,
warning->rule.bytes_percent == 0 ? "" :
t_strdup_printf(" (%u%%)", warning->rule.bytes_percent),
- (unsigned long long)warning->rule.count_limit,
+ warning->rule.count_limit,
warning->rule.count_percent == 0 ? "" :
t_strdup_printf(" (%u%%)", warning->rule.count_percent),
warning->reverse ? "yes" : "no",
if (!w->reverse) {
/* over quota (default) */
if (QUOTA_EXCEEDED(bytes_before, bytes_current, w->rule.bytes_limit)) {
- *reason_r = t_strdup_printf("bytes=%llu -> %llu over limit %llu",
- (unsigned long long)bytes_before,
- (unsigned long long)bytes_current,
- (unsigned long long)w->rule.bytes_limit);
+ *reason_r = t_strdup_printf("bytes=%"PRIu64" -> %"PRIu64" over limit %"PRId64,
+ bytes_before, bytes_current, w->rule.bytes_limit);
return TRUE;
}
if (QUOTA_EXCEEDED(count_before, count_current, w->rule.count_limit)) {
- *reason_r = t_strdup_printf("count=%llu -> %llu over limit %llu",
- (unsigned long long)count_before,
- (unsigned long long)count_current,
- (unsigned long long)w->rule.count_limit);
+ *reason_r = t_strdup_printf("count=%"PRIu64" -> %"PRIu64" over limit %"PRId64,
+ count_before, count_current, w->rule.count_limit);
return TRUE;
}
} else {
if (QUOTA_EXCEEDED(bytes_current, bytes_before, w->rule.bytes_limit)) {
- *reason_r = t_strdup_printf("bytes=%llu -> %llu below limit %llu",
- (unsigned long long)bytes_before,
- (unsigned long long)bytes_current,
- (unsigned long long)w->rule.bytes_limit);
+ *reason_r = t_strdup_printf("bytes=%"PRIu64" -> %"PRIu64" below limit %"PRId64,
+ bytes_before, bytes_current, w->rule.bytes_limit);
return TRUE;
}
if (QUOTA_EXCEEDED(count_current, count_before, w->rule.count_limit)) {
- *reason_r = t_strdup_printf("count=%llu -> %llu below limit %llu",
- (unsigned long long)count_before,
- (unsigned long long)count_current,
- (unsigned long long)w->rule.count_limit);
+ *reason_r = t_strdup_printf("count=%"PRIu64" -> %"PRIu64" below limit %"PRId64,
+ count_before, count_current, w->rule.count_limit);
return TRUE;
}
}
return;
}
if (root->quota->set->debug) {
- i_debug("quota: quota_over_flag check: %s ret=%d value=%llu limit=%llu",
- resources[i], ret,
- (unsigned long long)value,
- (unsigned long long)limit);
+ i_debug("quota: quota_over_flag check: %s ret=%d value=%"PRIu64" limit=%"PRIu64,
+ resources[i], ret, value, limit);
}
if (ret == QUOTA_GET_RESULT_LIMITED && value >= limit)
cur_overquota = TRUE;
if (size_expunged < size_needed) {
if (ctx->quota->user->mail_debug) {
i_debug("trash plugin: Failed to remove enough messages "
- "(needed %llu bytes, expunged only %llu bytes)",
- (unsigned long long)size_needed,
- (unsigned long long)size_expunged);
+ "(needed %"PRIu64" bytes, expunged only %"PRIu64" bytes)",
+ size_needed, size_expunged);
}
return 0;
}