qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/4] Fix compile of ivshmem on 32 bit hosts


From: Alexander Graf
Subject: [Qemu-devel] [PATCH 1/4] Fix compile of ivshmem on 32 bit hosts
Date: Fri, 3 Sep 2010 01:16:35 +0200

The compile of ivshmem.c on my ppc system breaks with the following error:

  ivshmem.c: In function ‘check_shm_size’:
  ivshmem.c:356: error: format ‘%ld’ expects type ‘long int’, but argument
                        4 has type ‘__off64_t’

This patch adds an explicit cast, making printf happy.

Signed-off-by: Alexander Graf <address@hidden>
---
 hw/ivshmem.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index bbb5cba..0c9cc84 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -351,9 +351,9 @@ static int check_shm_size(IVShmemState *s, int fd) {
     fstat(fd, &buf);
 
     if (s->ivshmem_size > buf.st_size) {
-        fprintf(stderr, "IVSHMEM ERROR: Requested memory size greater");
-        fprintf(stderr, " than shared object size (%" PRIu64 " > %ld)\n",
-                                          s->ivshmem_size, buf.st_size);
+        fprintf(stderr, "IVSHMEM ERROR: Requested memory size greater than "
+                        "shared object size (%" PRIu64 " > %" PRIu64 ")\n",
+                                      s->ivshmem_size, (uint64_t)buf.st_size);
         return -1;
     } else {
         return 0;
-- 
1.6.0.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]