diff options
author | Luyao Huang <lhuang@redhat.com> | 2014-10-20 15:55:00 +0200 |
---|---|---|
committer | Pavel Hrdina <phrdina@redhat.com> | 2014-10-20 17:06:12 +0200 |
commit | d8b7aa4b1839237e384e6547eb56f889046793ed (patch) | |
tree | fbefc5b1f75feec904a8f96a5ad91c0d796f4f8c | |
parent | 8feae56ce49135761038834932d755dff49922fe (diff) | |
download | libvirt-python-d8b7aa4b1839237e384e6547eb56f889046793ed.tar.gz |
Improve error output when use getTime with a nonzero flags.
When give a nonzero flags to getTime, c_retval will get -1 and goto
cleanup. But py_retval still is NULL, so set py_retval = VIR_PY_NONE.
This will make the output message more correct.
Signed-off-by: Luyao Huang <lhuang@redhat.com>
-rw-r--r-- | libvirt-override.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libvirt-override.c b/libvirt-override.c index 9ba87eb..c887b71 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -7757,8 +7757,10 @@ libvirt_virDomainGetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { c_retval = virDomainGetTime(domain, &seconds, &nseconds, flags); LIBVIRT_END_ALLOW_THREADS; - if (c_retval < 0) + if (c_retval < 0) { + py_retval = VIR_PY_NONE; goto cleanup; + } if (!(pyobj_seconds = libvirt_longlongWrap(seconds)) || PyDict_SetItemString(dict, "seconds", pyobj_seconds) < 0) |