diff options
author | Jeremy Huddleston <[email protected]> | 2012-04-28 16:50:00 -0700 |
---|---|---|
committer | Jeremy Huddleston <[email protected]> | 2012-05-03 10:58:33 -0700 |
commit | cf5db0a418b63d71385b43897a7ea9be7bb785d1 (patch) | |
tree | 3825c641d039bf0c78f898ac05eecb8128cd8844 /src/glx | |
parent | 244dc0521439379a0a44f81ba432aa04ca6c1a91 (diff) |
darwin: Make reported errors more user-friendly
Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/apple/apple_glx_drawable.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index db283023a63..3f84d560c53 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -32,6 +32,7 @@ #include <stdlib.h> #include <assert.h> #include <pthread.h> +#include <string.h> #include "apple_glx.h" #include "apple_glx_context.h" #include "apple_glx_drawable.h" @@ -48,8 +49,8 @@ lock_drawables_list(void) err = pthread_mutex_lock(&drawables_lock); if (err) { - fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n", - __func__, err); + fprintf(stderr, "pthread_mutex_lock failure in %s: %s\n", + __func__, strerror(err)); abort(); } } @@ -62,8 +63,8 @@ unlock_drawables_list(void) err = pthread_mutex_unlock(&drawables_lock); if (err) { - fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n", - __func__, err); + fprintf(stderr, "pthread_mutex_unlock failure in %s: %s\n", + __func__, strerror(err)); abort(); } } @@ -95,7 +96,7 @@ drawable_lock(struct apple_glx_drawable *agd) err = pthread_mutex_lock(&agd->mutex); if (err) { - fprintf(stderr, "pthread_mutex_lock error: %d\n", err); + fprintf(stderr, "pthread_mutex_lock error: %s\n", strerror(err)); abort(); } } @@ -108,7 +109,7 @@ drawable_unlock(struct apple_glx_drawable *d) err = pthread_mutex_unlock(&d->mutex); if (err) { - fprintf(stderr, "pthread_mutex_unlock error: %d\n", err); + fprintf(stderr, "pthread_mutex_unlock error: %s\n", strerror(err)); abort(); } } @@ -245,7 +246,7 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d) err = pthread_mutexattr_init(&attr); if (err) { - fprintf(stderr, "pthread_mutexattr_init error: %d\n", err); + fprintf(stderr, "pthread_mutexattr_init error: %s\n", strerror(err)); abort(); } @@ -257,14 +258,14 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d) err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); if (err) { - fprintf(stderr, "error: setting pthread mutex type: %d\n", err); + fprintf(stderr, "error: setting pthread mutex type: %s\n", strerror(err)); abort(); } err = pthread_mutex_init(&d->mutex, &attr); if (err) { - fprintf(stderr, "pthread_mutex_init error: %d\n", err); + fprintf(stderr, "pthread_mutex_init error: %s\n", strerror(err)); abort(); } |