Skip to contentSkip to conversation

ext2fs-lib.c - 64/32 bit issues

PATCH In review Ben Thomas 2 participants 2 messages Nov 9, 2006

lore
Share & tools
lore

Ben Thomas

author
#0 lore raw

PATCH 1/1 ext2fs-lib.c - 64/32 bit issues

Hi,

This won't compile on a 64 bit system. Another victim of long long and printf. I haven't noticed anything about it on the mailing list, so I believe that the attached patch may resolve this.

Signature · 5 lines
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
[email protected]                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                   Lowell, MA 01851
tools/libfsimage/ext2fs-lib/ext2fs-lib.c +2 -1
diff -r 452010ddef24 tools/libfsimage/ext2fs-lib/ext2fs-lib.c
@@ -24,6 +24,7 @@
 #include <fsimage_plugin.h>
 #include <ext2fs/ext2fs.h>
 #include <errno.h>
+#include <inttypes.h>
 
 static int
 ext2lib_mount(fsi_t *fsi, const char *name)
@@ -34,7 +35,7 @@ ext2lib_mount(fsi_t *fsi, const char *na
 	uint64_t offset = fsip_fs_offset(fsi);
 
 	if (offset)
-		snprintf(opts, 29, "offset=%lld", offset);
+		snprintf(opts, 29, "offset=%" PRId64, offset);
 
 	fs = malloc(sizeof (*fs));
 	if (fs == NULL)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · Ben Thomas

This won't compile on a 64 bit system. Another victim of long long and printf. I haven't noticed anything about it on the mailing list, so I believe that the attached patch may resolve this.

Thanks Ben, looks good to me. Sorry for not testing this case...

regards
john