diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-08-04 10:17:43 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-08-04 10:17:43 -0300 |
commit | 1568357e5cf18d4668de13daeb69aaea985b6250 (patch) | |
tree | 6d2bd8ff4ddfab209b3d8e086d41bdb8858853bf | |
parent | 28a2f17c069244f69ecdc6db2f5c280a9fe0c0da (diff) | |
download | python-schedutils-1568357e5cf18d4668de13daeb69aaea985b6250.tar.gz |
Fix cpusetsize parameter in sched_setaffinity call
When converting to CPU_ALLOC this was missed, so sizeof(pointer) was
being passed. "Works" up to 64cpus, fix it passing the value returned by
CPU_ALLOC_SIZE.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | python-schedutils/schedutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c index 65f1da7..d852d5d 100644 --- a/python-schedutils/schedutils.c +++ b/python-schedutils/schedutils.c @@ -179,7 +179,7 @@ static PyObject *set_affinity(PyObject *self __unused, PyObject *args) CPU_SET_S(cpu, cpusetsize, cpus); } - i = sched_setaffinity(pid, sizeof(cpus), cpus); + i = sched_setaffinity(pid, cpusetsize, cpus); CPU_FREE(cpus); if (i < 0) |