about summary refs log tree commit diff
path: root/nptl/pthread_attr_setschedpolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_attr_setschedpolicy.c')
-rw-r--r--nptl/pthread_attr_setschedpolicy.c5
1 files changed, 3 insertions, 2 deletions
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;