1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-25 18:50:51 +03:00

Fix some size_t printing.

This commit is contained in:
Alasdair Kergon 2005-01-20 18:14:04 +00:00
parent 4ed1990001
commit 0129c2b0fc
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.01.02 -
===================================
Fix some size_t printing.
Fix 64 bit xlate consts.
Split out pool sptype_names to avoid unused const.
Always fail if random id generation fails.

View File

@ -48,13 +48,14 @@ void *malloc_aux(size_t s, const char *file, int line)
size_t tsize = s + sizeof(*nb) + sizeof(unsigned long);
if (s > 50000000) {
log_error("Huge memory allocation (size %" PRIuPTR
log_error("Huge memory allocation (size %" PRIsize_t
") rejected - metadata corruption?", s);
return 0;
}
if (!(nb = malloc(tsize))) {
log_error("couldn't allocate any memory, size = %" PRIuPTR, s);
log_error("couldn't allocate any memory, size = %" PRIsize_t,
s);
return 0;
}
@ -190,7 +191,7 @@ int dump_memory(void)
str[sizeof(str) - 1] = '\0';
print_log(_LOG_INFO, mb->file, mb->line,
"block %d at %p, size %" PRIdPTR "\t [%s]",
"block %d at %p, size %" PRIsize_t "\t [%s]",
mb->id, mb->magic, mb->length, str);
tot += mb->length;
}
@ -220,7 +221,7 @@ void bounds_check(void)
void *malloc_aux(size_t s, const char *file, int line)
{
if (s > 50000000) {
log_error("Huge memory allocation (size %" PRIuPTR
log_error("Huge memory allocation (size %" PRIsize_t
") rejected - metadata corruption?", s);
return 0;
}