From 4340f49bf79a5421886363e08501ad347973b083 Mon Sep 17 00:00:00 2001 From: vehemens Date: Mon, 13 Aug 2007 10:17:47 -0700 Subject: Bug #11951: Fix an errno sign inversion on pre-FreeBSD 5. Also, annotate where signs change, to hopefully remind the reader of these issues in the future. --- bsd-core/drmP.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 73342d09..8a768f0c 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -377,6 +377,7 @@ do { \ } while (0) #if defined(__FreeBSD__) && __FreeBSD_version > 500000 +/* Returns -errno to shared code */ #define DRM_WAIT_ON( ret, queue, timeout, condition ) \ for ( ret = 0 ; !ret && !(condition) ; ) { \ DRM_UNLOCK(); \ @@ -388,11 +389,12 @@ for ( ret = 0 ; !ret && !(condition) ; ) { \ DRM_LOCK(); \ } #else +/* Returns -errno to shared code */ #define DRM_WAIT_ON( ret, queue, timeout, condition ) \ for ( ret = 0 ; !ret && !(condition) ; ) { \ int s = spldrm(); \ if (!(condition)) \ - ret = tsleep( &(queue), PZERO | PCATCH, \ + ret = -tsleep( &(queue), PZERO | PCATCH, \ "drmwtq", (timeout) ); \ splx(s); \ } -- cgit v1.2.3