Browse files

Fix the build on x86_64

The compiler points out that the comparison between "int request"
and BLKGETSIZE64 is always false, since BLKGETSIZE64 is a large
long long.

Signed-off-by: David Scott <>
  • Loading branch information...
1 parent 4a556d4 commit 3b6897f9f9d483efd0272aa2c4d2d8e4a01e45fe David Scott committed Jun 1, 2012
Showing with 11 additions and 3 deletions.
  1. +11 −3 vhd/lib/libvhdio.c
@@ -1425,18 +1425,26 @@ __lxstat64(int version, const char *path, struct stat64 *buf)
return ret;
+#ifdef __x86_64__
+#define IOCTL_REQUEST long long
+#define IOCTL_REQUEST_FMT "%Lx"
+#define IOCTL_REQUEST int
+#define IOCTL_REQUEST_FMT "%x"
-ioctl(int fd, int request, char *argp)
+ioctl(int fd, IOCTL_REQUEST request, char *argp)
vhd_fd_context_t *vhd_fd;
- static int (*_std_ioctl)(int, int, char *);
+ static int (*_std_ioctl)(int, IOCTL_REQUEST, char *);
vhd_fd = _libvhd_io_map_get(fd);
if (!vhd_fd)
return _std_ioctl(fd, request, argp);
- LOG("%s 0x%x 0x%x %p\n", __func__, fd, request, argp);
+ LOG("%s 0x%x 0x" IOCTL_REQUEST_FMT " %p\n", __func__, fd, request, argp);
if (request == BLKGETSIZE64) {

0 comments on commit 3b6897f

Please sign in to comment.