From d8b7aa4b1839237e384e6547eb56f889046793ed Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Mon, 20 Oct 2014 15:55:00 +0200 Subject: 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 --- libvirt-override.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1