]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Yet another fix for #12763: test_posix failure on OpenIndiana
authorJesus Cea <jcea@jcea.es>
Fri, 9 Sep 2011 23:40:52 +0000 (01:40 +0200)
committerJesus Cea <jcea@jcea.es>
Fri, 9 Sep 2011 23:40:52 +0000 (01:40 +0200)
Modules/posixmodule.c

index d9d9acb9898ce16195857df1d877cd0a25e80b29..df597b887b3f6ed48758002cf9236d80801b9d1c 100644 (file)
@@ -4741,7 +4741,13 @@ posix_sched_setscheduler(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, _Py_PARSE_PID "iO&:sched_setscheduler",
                           &pid, &policy, &convert_sched_param, &param))
         return NULL;
-    if (sched_setscheduler(pid, policy, &param))
+
+    /*
+    ** sched_setscheduler() returns 0 in Linux, but
+    ** the previous scheduling policy.
+    ** On error, -1 is returned in all Operative Systems.
+    */
+    if (sched_setscheduler(pid, policy, &param) == -1)
         return posix_error();
     Py_RETURN_NONE;
 }