diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-10-15 15:35:51 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-10-15 15:35:51 +0200 |
commit | 3df9f3572bb4e5da99aa2d9fd5c031cdb1653bfd (patch) | |
tree | f735d92612d7d8348d848ff3e8a924ea4eae8727 /virtiotest.c | |
parent | 234100550533c5e58d9b3ec9bc8d371ca0ecec32 (diff) | |
download | drminfo-3df9f3572bb4e5da99aa2d9fd5c031cdb1653bfd.tar.gz |
fix getparam ioctl
Diffstat (limited to 'virtiotest.c')
-rw-r--r-- | virtiotest.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/virtiotest.c b/virtiotest.c index 2278433..bf16bc8 100644 --- a/virtiotest.c +++ b/virtiotest.c @@ -38,19 +38,19 @@ static struct { static uint64_t virtio_get_cap(uint64_t cap) { - struct drm_virtgpu_getparam param = { - .param = cap, - .value = 0, - }; + struct drm_virtgpu_getparam args; + int value = 0; int rc; - rc = drmIoctl(fd, DRM_IOCTL_VIRTGPU_GETPARAM, ¶m); + args.param = cap; + args.value = (intptr_t)(&value); + rc = drmIoctl(fd, DRM_IOCTL_VIRTGPU_GETPARAM, &args); if (rc != 0) { fprintf(stderr, "ioctl DRM_IOCTL_VIRTGPU_GETPARAM(%" PRId64 "): %s\n", cap, strerror(errno)); exit(1); } - return param.value; + return value; } static void virtio_print_caps(void) |