summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-01-30 13:05:55 -0800
committerGary E. Miller <gem@rellim.com>2015-01-30 13:05:55 -0800
commitf94231eac20bcd83c7ba3d94b7c013406d3b4e23 (patch)
tree39f372060e08348454832b7b0d9148b822c233c5 /libgpsd_core.c
parent7de7d9791e85a5a1b2895c111e00a61f3fad76a0 (diff)
downloadgpsd-f94231eac20bcd83c7ba3d94b7c013406d3b4e23.tar.gz
Restore hastily removed checks on pthread usage.
Any failure of pthread_mutex_lock() is a fatal error.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index bb3ea56c..726e6976 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -62,16 +62,28 @@ static pthread_mutex_t report_mutex;
void gpsd_acquire_reporting_lock(void)
{
+ int err;
/*@ -unrecog (splint has no pthread declarations as yet) @*/
- pthread_mutex_lock(&report_mutex);
+ err = pthread_mutex_lock(&report_mutex);
/*@ +unrecog @*/
+ if ( 0 != err ) {
+ (void) fprintf(stderr,"pthread_mutex_lock() failed: %s\n",
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
}
void gpsd_release_reporting_lock(void)
{
+ int err;
/*@ -unrecog (splint has no pthread declarations as yet) @*/
- pthread_mutex_unlock(&report_mutex);
+ err = pthread_mutex_unlock(&report_mutex);
/*@ +unrecog @*/
+ if ( 0 != err ) {
+ (void) fprintf(stderr,"pthread_mutex_unlock() failed: %s\n",
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
}
#endif /* PPS_ENABLE */