aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-08-01 18:58:19 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-08-01 19:12:17 -0300
commit76269f0df6224c1d9a9183a7f4fceaa16d5ca398 (patch)
treec86eda843a29dc6a3a71f5085b504db1ec4f74bd
parent80ce42f1a7a880aeae1ae11775456c0d53519459 (diff)
downloadpython-schedutils-76269f0df6224c1d9a9183a7f4fceaa16d5ca398.tar.gz
Don't set the error string twice
We were setting it to "Invalid CPU" to then reset it to whatever was in errno. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--python-schedutils/schedutils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c
index 206f5ab..dfc7cb5 100644
--- a/python-schedutils/schedutils.c
+++ b/python-schedutils/schedutils.c
@@ -176,7 +176,8 @@ static PyObject *set_affinity(PyObject *self __unused, PyObject *args)
if (cpu >= max_cpus) {
PyErr_SetString(PyExc_OSError, "Invalid CPU");
- goto out_free;
+ CPU_FREE(cpus);
+ return NULL;
}
CPU_SET_S(cpu, cpusetsize, cpus);
}
@@ -189,8 +190,6 @@ static PyObject *set_affinity(PyObject *self __unused, PyObject *args)
out:
Py_INCREF(Py_None);
return Py_None;
-out_free:
- CPU_FREE(cpus);
out_error:
PyErr_SetFromErrno(PyExc_OSError);
goto out;