summaryrefslogtreecommitdiffstats
path: root/c/src/exec/posix/src/mutex.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-05-31 21:40:48 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-05-31 21:40:48 +0000
commitc238a2189d15121d62faa56982cbf17f22bd5b3e (patch)
tree9c097b85d04b69cc2e11d1549f1e2349f3cd1459 /c/src/exec/posix/src/mutex.c
parentf31da72ce45608bd737c74e8bb09e4bb1731cd8f (diff)
downloadrtems-c238a2189d15121d62faa56982cbf17f22bd5b3e.tar.bz2
added checks to validate values passed to set attribute routines
Diffstat (limited to 'c/src/exec/posix/src/mutex.c')
-rw-r--r--c/src/exec/posix/src/mutex.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/c/src/exec/posix/src/mutex.c b/c/src/exec/posix/src/mutex.c
index 51ac6e097c..a3b81da52d 100644
--- a/c/src/exec/posix/src/mutex.c
+++ b/c/src/exec/posix/src/mutex.c
@@ -151,8 +151,15 @@ int pthread_mutexattr_setpshared(
if ( !attr )
return EINVAL;
- attr->process_shared = pshared;
- return 0;
+ switch ( pshared ) {
+ case PTHREAD_PROCESS_SHARED:
+ case PTHREAD_PROCESS_PRIVATE:
+ attr->process_shared = pshared;
+ return 0;
+
+ default:
+ return EINVAL;
+ }
}
/*PAGE
@@ -466,8 +473,16 @@ int pthread_mutexattr_setprotocol(
if ( !attr )
return EINVAL;
- attr->protocol = protocol;
- return 0;
+ switch ( protocol ) {
+ case PTHREAD_PRIO_NONE:
+ case PTHREAD_PRIO_INHERIT:
+ case PTHREAD_PRIO_PROTECT:
+ attr->protocol = protocol;
+ return 0;
+
+ default:
+ return EINVAL;
+ }
}
/*PAGE