Patchwork ivshmem: fix build on a 32 bit system

login
register
mail settings
Submitter Michael S. Tsirkin
Date Sept. 5, 2010, 6:14 p.m.
Message ID <20100905181435.GA24728@redhat.com>
Download mbox | patch
Permalink /patch/63851/
State New
Headers show

Comments

Michael S. Tsirkin - Sept. 5, 2010, 6:14 p.m.
/scm/qemu/hw/ivshmem.c: In function ‘check_shm_size’:
/scm/qemu/hw/ivshmem.c:356: error: format ‘%ld’ expects type ‘long int’,
but argument 4 has type ‘__off64_t’

Fix by casting to u64.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/ivshmem.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index bbb5cba..6f41383 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -352,8 +352,9 @@  static int check_shm_size(IVShmemState *s, int fd) {
 
     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, " than shared object size "
+                "(%" PRIu64 " > %" PRIu64 "d)\n",
+                s->ivshmem_size, (uint64_t)buf.st_size);
         return -1;
     } else {
         return 0;