summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_setschedparam.c
diff options
context:
space:
mode:
authorJason Evans <jasone@FreeBSD.org>2000-05-02 06:51:40 +0000
committerJason Evans <jasone@FreeBSD.org>2000-05-02 06:51:40 +0000
commit4c089f4dffe2205b8c8833d43180fbde6d42d9e7 (patch)
tree38805ba5432d7b1c6b57979a58a7041d2bfbe944 /lib/libpthread/thread/thr_setschedparam.c
parent2b91ff7819ded094a0356e6ba4e2164d467ae720 (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_setschedparam.c')
-rw-r--r--lib/libpthread/thread/thr_setschedparam.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_setschedparam.c b/lib/libpthread/thread/thr_setschedparam.c
index f080d5ddba57..bce965fe6603 100644
--- a/lib/libpthread/thread/thr_setschedparam.c
+++ b/lib/libpthread/thread/thr_setschedparam.c
@@ -43,14 +43,16 @@ pthread_setschedparam(pthread_t pthread, int policy,
{
int old_prio, in_readyq = 0, ret = 0;
- if ((param == NULL) || (param->sched_priority < PTHREAD_MIN_PRIORITY) ||
- (param->sched_priority > PTHREAD_MAX_PRIORITY) ||
- (policy < SCHED_FIFO) || (policy > SCHED_RR))
+ if ((param == NULL) || (policy < SCHED_FIFO) || (policy > SCHED_RR)) {
/* Return an invalid argument error: */
ret = EINVAL;
+ } else if ((param->sched_priority < PTHREAD_MIN_PRIORITY) ||
+ (param->sched_priority > PTHREAD_MAX_PRIORITY)) {
+ /* Return an unsupported value error. */
+ ret = ENOTSUP;
/* Find the thread in the list of active threads: */
- else if ((ret = _find_thread(pthread)) == 0) {
+ } else if ((ret = _find_thread(pthread)) == 0) {
/*
* Defer signals to protect the scheduling queues from
* access by the signal handler: