[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] build: Fix build warning on libvirt-python



From: Mo Yuxiang <Moyuxiang huawei com>

On compiling libvirt-python, we get such a warning:

libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
libvirt-qemu-override.c:304: warning: suggest explicit braces to avoid ambiguous ‘else’

Py_DECREF is a macro. The solution is to add brackets.

Signed-off-by: Mo Yuxiang <Moyuxiang huawei com>
---
 libvirt-qemu-override.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libvirt-qemu-override.c b/libvirt-qemu-override.c
index 05ead30..8be3755 100644
--- a/libvirt-qemu-override.c
+++ b/libvirt-qemu-override.c
@@ -301,8 +301,9 @@ libvirt_qemu_virConnectDomainQemuMonitorEventRegister(PyObject *self ATTRIBUTE_U
                                                    flags);
     LIBVIRT_END_ALLOW_THREADS;
 
-    if (ret < 0)
+    if (ret < 0) {
         Py_DECREF(pyobj_cbData);
+    }
 
     py_retval = libvirt_intWrap(ret);
     return py_retval;
-- 
1.7.12.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]