diff options
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r-- | libdrm/xf86drm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 1f242fe3..93185512 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -3260,7 +3260,8 @@ int drmMMLock(int fd, unsigned memType) do{ ret = ioctl(fd, DRM_IOCTL_MM_INIT, &arg); } while (ret && errno == EAGAIN); - return -errno; + + return (ret) ? -errno : 0; } int drmMMUnlock(int fd, unsigned memType) @@ -3275,7 +3276,8 @@ int drmMMUnlock(int fd, unsigned memType) do{ ret = ioctl(fd, DRM_IOCTL_MM_INIT, &arg); } while (ret && errno == EAGAIN); - return -errno; + + return (ret) ? -errno : 0; } #define DRM_MAX_FDS 16 |