Fix DLog format specifier for 64-bit architecures 26/195826/2
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 18 Dec 2018 11:15:40 +0000 (12:15 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 18 Dec 2018 14:34:40 +0000 (15:34 +0100)
Change-Id: I3f29eb0dc3e5081843f0c982dab92cd45aad1364

src/crash-manager/crash-manager.c
src/crash-stack/proc.c

index 215904b..1cba5ee 100644 (file)
@@ -23,6 +23,7 @@
 #include <unistd.h>
 #include <libgen.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <sys/mman.h>
 #include <sys/procfs.h>
 #include <sys/stat.h>
@@ -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;
index da21663..46f40e1 100644 (file)
@@ -41,6 +41,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
 #include <sys/time.h>
@@ -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;
             }