diff options
author | Jesus Cea <jcea@jcea.es> | 2011-09-09 23:40:52 (GMT) |
---|---|---|
committer | Jesus Cea <jcea@jcea.es> | 2011-09-09 23:40:52 (GMT) |
commit | 9c8222727789900a3a76374e957ff2d90f1216c4 (patch) | |
tree | 5f22a6373b82520b89adb90b04087dcd6a6b6063 /Modules | |
parent | ceb5d169e97201b870a8400bb9c67036c3c53969 (diff) | |
download | cpython-9c8222727789900a3a76374e957ff2d90f1216c4.zip cpython-9c8222727789900a3a76374e957ff2d90f1216c4.tar.gz cpython-9c8222727789900a3a76374e957ff2d90f1216c4.tar.bz2 |
Yet another fix for #12763: test_posix failure on OpenIndiana
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d9d9acb..df597b8 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; } |