aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Slusarz2011-06-05 11:53:16 -0500
committerMarcin Slusarz2011-09-18 08:25:18 -0500
commit763b618d55a973807823bb1a1c6e60b9e2db6d8b (patch)
tree16136d83696d9b1b6651f7d77ccb1fc6fc80dec1 /xf86drmMode.c
parent2acaf160df584a5ef7b5c5b84819389948cd97ad (diff)
downloadexternal-libgbm-763b618d55a973807823bb1a1c6e60b9e2db6d8b.tar.gz
external-libgbm-763b618d55a973807823bb1a1c6e60b9e2db6d8b.tar.xz
external-libgbm-763b618d55a973807823bb1a1c6e60b9e2db6d8b.zip
drm mode: fix drmIoctl wrapper
Both drmIoctl and ioctl define second argument as unigned long. Debugging/tracing tools (like strace or valgrind) on 64-bit machines see different request value for ioctls with 32nd bit set, because casting signed int to unsigned long extends 32nd bit to upper word, so 0x80000000 becomes 0xFFFFFFFF80000000) Nobody noticed because higher 32 bits are chopped off on their way to kernel.
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index c94e40ce..f08e6480 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -52,7 +52,7 @@
52#define U642VOID(x) ((void *)(unsigned long)(x)) 52#define U642VOID(x) ((void *)(unsigned long)(x))
53#define VOID2U64(x) ((uint64_t)(unsigned long)(x)) 53#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
54 54
55static inline int DRM_IOCTL(int fd, int cmd, void *arg) 55static inline int DRM_IOCTL(int fd, unsigned long cmd, void *arg)
56{ 56{
57 int ret = drmIoctl(fd, cmd, arg); 57 int ret = drmIoctl(fd, cmd, arg);
58 return ret < 0 ? -errno : ret; 58 return ret < 0 ? -errno : ret;