forked from wolfSSL/wolfssl
TIRTOS Semaphore_create error check
This commit is contained in:
@ -353,17 +353,20 @@ int UnLockMutex(wolfSSL_Mutex *m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif defined (WOLFSSL_TIRTOS)
|
#elif defined (WOLFSSL_TIRTOS)
|
||||||
|
#include <xdc/runtime/Error.h>
|
||||||
int InitMutex(wolfSSL_Mutex* m)
|
int InitMutex(wolfSSL_Mutex* m)
|
||||||
{
|
{
|
||||||
Semaphore_Params params;
|
Semaphore_Params params;
|
||||||
|
Error_Block eb;
|
||||||
|
Error_init(&eb);
|
||||||
Semaphore_Params_init(¶ms);
|
Semaphore_Params_init(¶ms);
|
||||||
params.mode = Semaphore_Mode_BINARY;
|
params.mode = Semaphore_Mode_BINARY;
|
||||||
|
|
||||||
*m = Semaphore_create(1, ¶ms, NULL);
|
*m = Semaphore_create(1, ¶ms, &eb);
|
||||||
|
if( Error_check( &eb ) )
|
||||||
return 0;
|
{
|
||||||
|
Error_raise( &eb, Error_E_generic, "Failed to Create the semaphore.",NULL);
|
||||||
|
} else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FreeMutex(wolfSSL_Mutex* m)
|
int FreeMutex(wolfSSL_Mutex* m)
|
||||||
|
Reference in New Issue
Block a user