From 2f379db2c637bda9c84b8606fdc9bbb2b721e5f8 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 18 Dec 2018 12:15:40 +0100 Subject: [PATCH] Fix DLog format specifier for 64-bit architecures Change-Id: I3f29eb0dc3e5081843f0c982dab92cd45aad1364 --- src/crash-manager/crash-manager.c | 5 +++-- src/crash-stack/proc.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c index 215904b..1cba5ee 100644 --- a/src/crash-manager/crash-manager.c +++ b/src/crash-manager/crash-manager.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -976,7 +977,7 @@ static int scan_dump(struct file_info **dump_list, off_t *usage) *usage = 0; for (i = 0; i < dump_num; i++) { - _D("[%d] path: %s(%s), size: %d kb, mtime: %s", + _D("[%d] path: %s(%s), size: %zu kb, mtime: %s", i, temp_list[i].path, temp_list[i].isdir ? "DIR" : "FILE", @@ -1065,7 +1066,7 @@ static void clean_dump(void) dump_list[i].path); break; case USAGE_EXCEED: - _I("Reached the maximum disk usage %lld/%d kb, so remove (%s)", + _I("Reached the maximum disk usage %" PRId64 "/%d kb, so remove (%s)", usage / 1024, system_max_use, dump_list[i].path); break; diff --git a/src/crash-stack/proc.c b/src/crash-stack/proc.c index da21663..46f40e1 100644 --- a/src/crash-stack/proc.c +++ b/src/crash-stack/proc.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -472,7 +473,7 @@ static int copy_memory_proc_mem(int pid, struct mem_data_chunk **frames, ssize_t rd = pread(fd, to, count, from); if (rd == -1) { - _E("pread() at %s:0x%llx (#%d) failed: %m [%d]", + _E("pread() at %s:0x%" PRIx64 " (#%d) failed: %m [%d]", fname, from, i, errno); goto proc_mem_end; } -- 2.7.4