Patchwork [1/2] ivshmem: Fix compilation (wrong format specifier)

login
register
mail settings
Submitter Stefan Weil
Date Aug. 11, 2010, 7:38 a.m.
Message ID <1281512334-4268-1-git-send-email-weil@mail.berlios.de>
Download mbox | patch
Permalink /patch/61459/
State New
Headers show

Comments

Stefan Weil - Aug. 11, 2010, 7:38 a.m.
st_size is an off32_t or off64_t, so %ld does not always work.

Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 hw/ivshmem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index bbb5cba..ec894e9 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -352,8 +352,8 @@  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 ")\n",
+                                          s->ivshmem_size, (uint64_t)buf.st_size);
         return -1;
     } else {
         return 0;