Patchwork [1/4] Fix compile of ivshmem on 32 bit hosts

login
register
mail settings
Submitter Alexander Graf
Date Sept. 2, 2010, 11:16 p.m.
Message ID <1283469398-19965-2-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/63583/
State New
Headers show

Comments

Alexander Graf - Sept. 2, 2010, 11:16 p.m.
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 <agraf@suse.de>
---
 hw/ivshmem.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

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;