@@ -552,20 +552,30 @@ static Cache *Cache_alloc(void)
552
552
*/
553
553
static void Cache_free (Cache * cf )
554
554
{
555
- if (pthread_mutex_destroy (& cf -> seek_lock )) {
556
- lprintf (fatal , "could not destroy seek_lock: %s!\n" , strerror (errno ));
555
+ int err_code = 0 ;
556
+
557
+ err_code = pthread_mutex_destroy (& cf -> seek_lock );
558
+ if (err_code ) {
559
+ lprintf (fatal , "could not destroy seek_lock: %d, %s!\n" , err_code ,
560
+ strerror (err_code ));
557
561
}
558
562
559
- if (pthread_mutex_destroy (& cf -> w_lock )) {
560
- lprintf (fatal , "could not destroy w_lock: %s!\n" , strerror (errno ));
563
+ err_code = pthread_mutex_destroy (& cf -> w_lock );
564
+ if (err_code ) {
565
+ lprintf (fatal , "could not destroy w_lock: %d, %s!\n" , err_code ,
566
+ strerror (err_code ));
561
567
}
562
568
563
- if (pthread_mutex_destroy (& cf -> bgt_lock )) {
564
- lprintf (fatal , "could not destroy bgt_lock: %s!\n" , strerror (errno ));
569
+ err_code = pthread_mutex_destroy (& cf -> bgt_lock );
570
+ if (err_code ) {
571
+ lprintf (fatal , "could not destroy bgt_lock: %d, %s!\n" , err_code ,
572
+ strerror (err_code ));
565
573
}
566
574
567
- if (pthread_mutexattr_destroy (& cf -> bgt_lock_attr )) {
568
- lprintf (fatal , "could not destroy bgt_lock_attr: %s!\n" , strerror (errno ));
575
+ err_code = pthread_mutexattr_destroy (& cf -> bgt_lock_attr );
576
+ if (err_code ) {
577
+ lprintf (fatal , "could not destroy bgt_lock_attr: %d, %s!\n" , err_code ,
578
+ strerror (err_code ));
569
579
}
570
580
571
581
if (cf -> path ) {
0 commit comments