提交 63b06c0e 编写于 作者: R Rich Felker

reject invalid attribute settings

note that this is a pedantic conformance issue and waste of code. it
only affects broken code or code that is probing for conformance.
上级 951e7640
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
int pthread_attr_setdetachstate(pthread_attr_t *a, int state) int pthread_attr_setdetachstate(pthread_attr_t *a, int state)
{ {
if (state > 1U) return EINVAL;
a->_a_detach = state; a->_a_detach = state;
return 0; return 0;
} }
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
int pthread_attr_setscope(pthread_attr_t *a, int scope) int pthread_attr_setscope(pthread_attr_t *a, int scope)
{ {
if (scope > 1U) return EINVAL;
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册