[CRIU] [PATCH 2/8] cr-restore.c: fix printf format warnings
Kir Kolyshkin
kir at openvz.org
Tue Jan 31 06:31:22 EST 2012
cr-restore.c: In function ‘fixup_vma_fds’:
cr-restore.c:578:4: error: format ‘%d’ expects type ‘int’, but argument 6 has type ‘long unsigned int’
cr-restore.c: In function ‘sigreturn_restore’:
cr-restore.c:1693:4: error: format ‘%li’ expects type ‘long int’, but argument 4 has type ‘int’
cr-restore.c:1738:3: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long int’
cr-restore.c:1751:3: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long int’
cr-restore.c:1755:3: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
cr-restore.c:1868:4: error: format ‘%8p’ expects type ‘void *’, but argument 3 has type ‘long int’
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
cr-restore.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/cr-restore.c b/cr-restore.c
index f917562..cf76e97 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -575,7 +575,7 @@ static int fixup_vma_fds(int pid, int fd)
if (ret < 0) {
pr_perror("%d: Can't read vma_entry", pid);
} else if (ret != sizeof(vi)) {
- pr_err("%d: Incomplete vma_entry (%d != %d)\n",
+ pr_err("%d: Incomplete vma_entry (%d != %ld)\n",
pid, ret, sizeof(vi));
return -1;
}
@@ -1686,7 +1686,7 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
list_for_each_entry(vma_area, &self_vma_list, list) {
ret = write(fd_self_vmas, &vma_area->vma, sizeof(vma_area->vma));
if (ret != sizeof(vma_area->vma)) {
- pr_perror("\nUnable to write vma entry (%li written)", num);
+ pr_perror("\nUnable to write vma entry (%d written)", num);
goto err;
}
num++;
@@ -1731,7 +1731,7 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
restore_thread_vma_len = sizeof(*thread_args) * pstree_entry.nr_threads;
restore_thread_vma_len = round_up(restore_thread_vma_len, 16);
- pr_info("%d: %d threads require %dK of memory\n",
+ pr_info("%d: %d threads require %ldK of memory\n",
pid, pstree_entry.nr_threads,
KBYTES(restore_thread_vma_len));
break;
@@ -1744,11 +1744,11 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
restore_thread_vma_len +
SHMEMS_SIZE + TASK_ENTRIES_SIZE);
if (exec_mem_hint == -1) {
- pr_err("No suitable area for task_restore bootstrap (%dK)\n",
+ pr_err("No suitable area for task_restore bootstrap (%ldK)\n",
restore_task_vma_len + restore_thread_vma_len);
goto err;
} else {
- pr_info("Found bootstrap VMA hint at: %lx (needs ~%dK)\n",
+ pr_info("Found bootstrap VMA hint at: %lx (needs ~%ldK)\n",
exec_mem_hint,
KBYTES(restore_task_vma_len + restore_thread_vma_len));
}
@@ -1862,7 +1862,7 @@ static void sigreturn_restore(pid_t pstree_pid, pid_t pid)
thread_args[i].rst_lock = &task_args->rst_lock;
pr_info("Thread %4d stack %8p heap %8p rt_sigframe %8p\n",
- i, (long)thread_args[i].mem_zone.stack,
+ i, thread_args[i].mem_zone.stack,
thread_args[i].mem_zone.heap,
thread_args[i].mem_zone.rt_sigframe);
--
1.7.4.4
More information about the CRIU
mailing list