diff --git a/src/sbbs3/ssl.c b/src/sbbs3/ssl.c index 29bc640921f622d4e7ea3c63d38d3fc1ea0b843e..9a1adba1259818245628e50328ca8b5bc08afec4 100644 --- a/src/sbbs3/ssl.c +++ b/src/sbbs3/ssl.c @@ -270,25 +270,25 @@ static void internal_do_cryptInit(void) if (!rwlock_init(&cert_epoch_lock)) return; if (!rwlock_init(&tls_cert_file_date_lock)) { - rwlock_destroy(&cert_epoch_lock); + rwlock_destroy_ign(&cert_epoch_lock); return; } if (pthread_mutex_init(&ssl_cert_list_mutex, NULL) != 0) { - rwlock_destroy(&tls_cert_file_date_lock); - rwlock_destroy(&cert_epoch_lock); + rwlock_destroy_ign(&tls_cert_file_date_lock); + rwlock_destroy_ign(&cert_epoch_lock); return; } if (pthread_mutex_init(&ssl_sess_list_mutex, NULL) != 0) { pthread_mutex_destroy(&ssl_cert_list_mutex); - rwlock_destroy(&tls_cert_file_date_lock); - rwlock_destroy(&cert_epoch_lock); + rwlock_destroy_ign(&tls_cert_file_date_lock); + rwlock_destroy_ign(&cert_epoch_lock); return; } if (pthread_mutex_init(&get_ssl_cert_mutex, NULL) != 0) { pthread_mutex_destroy(&ssl_sess_list_mutex); pthread_mutex_destroy(&ssl_cert_list_mutex); - rwlock_destroy(&tls_cert_file_date_lock); - rwlock_destroy(&cert_epoch_lock); + rwlock_destroy_ign(&tls_cert_file_date_lock); + rwlock_destroy_ign(&cert_epoch_lock); return; } diff --git a/src/xpdev/rwlockwrap.h b/src/xpdev/rwlockwrap.h index eb077a2717d371dbaf0e098f42c8866d28bbad6f..bdfd4c58d77191bb7d2cbef47a1485adaa4a83a8 100644 --- a/src/xpdev/rwlockwrap.h +++ b/src/xpdev/rwlockwrap.h @@ -13,6 +13,7 @@ typedef pthread_rwlock_t rwlock_t; #define rwlock_trywrlock(lock) (pthread_rwlock_trywrlock(lock) == 0) #define rwlock_unlock(lock) (pthread_rwlock_unlock(lock) == 0) #define rwlock_destroy(lock) (pthread_rwlock_destroy(lock) == 0) +#define rwlock_destroy_ign(lock) ((void)pthread_rwlock_destroy(lock)) #elif defined(_WIN32)