From da1304bcc8d718f40e58d92726c0fbc7b0d0794d Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 22 Apr 2013 10:28:31 +0530 Subject: Consolidate pthread_attr value validation Define inline functions that wrap around validation for each of the pthread attributes to reduce duplication in code. --- nptl/pthread_attr_setschedpolicy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nptl/pthread_attr_setschedpolicy.c') diff --git a/nptl/pthread_attr_setschedpolicy.c b/nptl/pthread_attr_setschedpolicy.c index 2fa6921690..4fe0b8e102 100644 --- a/nptl/pthread_attr_setschedpolicy.c +++ b/nptl/pthread_attr_setschedpolicy.c @@ -32,8 +32,9 @@ __pthread_attr_setschedpolicy (attr, policy) iattr = (struct pthread_attr *) attr; /* Catch invalid values. */ - if (policy != SCHED_OTHER && policy != SCHED_FIFO && policy != SCHED_RR) - return EINVAL; + int ret = check_sched_policy_attr (policy); + if (ret) + return ret; /* Store the new values. */ iattr->schedpolicy = policy; -- cgit v1.2.3