Commit 963ecf2aec9d6486181317fb0258fec9b728da0f

Stefan Sperling 2019-08-12T09:31:52

don't let a pthread mutex unlock error mask other errors in tog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
 }