From: Jesus Cea Date: Fri, 9 Sep 2011 23:40:52 +0000 (+0200) Subject: Yet another fix for #12763: test_posix failure on OpenIndiana X-Git-Tag: v3.3.0a1~1556 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c8222727789900a3a76374e957ff2d90f1216c4;p=thirdparty%2FPython%2Fcpython.git Yet another fix for #12763: test_posix failure on OpenIndiana --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d9d9acb9898c..df597b887b3f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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, ¶m)) return NULL; - if (sched_setscheduler(pid, policy, ¶m)) + + /* + ** 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, ¶m) == -1) return posix_error(); Py_RETURN_NONE; }