don't let a pthread mutex unlock error mask other errors in tog
diff --git a/tog/tog.c b/tog/tog.c
index 8502649..bc0c94f 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -860,8 +860,8 @@ done:
}
errcode = pthread_mutex_unlock(&tog_mutex);
- if (errcode)
- return got_error_set_errno(errcode, "pthread_mutex_unlock");
+ if (errcode && err == NULL)
+ err = got_error_set_errno(errcode, "pthread_mutex_unlock");
return err;
}