lib/mutex: silent success on closing an uninit mutex

This commit is contained in:
Philippe Gerum 2019-03-08 17:01:33 +01:00
parent 10afb077ff
commit 75fb37bf92
1 changed files with 3 additions and 0 deletions

View File

@ -168,6 +168,9 @@ int evl_close_mutex(struct evl_mutex *mutex)
{
int efd;
if (mutex->magic == __MUTEX_UNINIT_MAGIC)
return 0;
if (mutex->magic != __MUTEX_ACTIVE_MAGIC)
return -EINVAL;