File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,10 @@ int pthread_mutex_destroy(pthread_mutex_t *mu)
307
307
int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * attr ,
308
308
int * protocol )
309
309
{
310
+ if ((attr == NULL ) || (protocol == NULL )) {
311
+ return EINVAL ;
312
+ }
313
+
310
314
* protocol = PTHREAD_PRIO_NONE ;
311
315
return 0 ;
312
316
}
Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ static void test_mutex_common(int type, void *(*entry)(void *arg))
60
60
61
61
zassert_ok (pthread_mutexattr_gettype (& mut_attr , & actual_type ),
62
62
"reading mutex type is failed" );
63
+ zassert_not_ok (pthread_mutexattr_getprotocol (NULL , & protocol ));
64
+ zassert_not_ok (pthread_mutexattr_getprotocol (& mut_attr , NULL ));
65
+ zassert_not_ok (pthread_mutexattr_getprotocol (NULL , NULL ));
63
66
zassert_ok (pthread_mutexattr_getprotocol (& mut_attr , & protocol ),
64
67
"reading mutex protocol is failed" );
65
68
zassert_ok (pthread_mutexattr_destroy (& mut_attr ));
You can’t perform that action at this time.
0 commit comments