summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-06-13 15:59:28 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-06-13 15:59:28 +0200
commit2407ce57de36470e767ebc1800cbbec74cab0ae4 (patch)
tree7e7d8c393d5a45dfc108f1360e3b7d48e583f9cd
parent62082ab3e63f6f474655da98b710e453b4124ed1 (diff)
Fix drmMMUnlock / drmMMLock return values.
-rw-r--r--libdrm/xf86drm.c6
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