diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-08-01 18:58:19 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-08-01 19:12:17 -0300 |
commit | 76269f0df6224c1d9a9183a7f4fceaa16d5ca398 (patch) | |
tree | c86eda843a29dc6a3a71f5085b504db1ec4f74bd | |
parent | 80ce42f1a7a880aeae1ae11775456c0d53519459 (diff) | |
download | python-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.c | 5 |
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; |