[PATCH 4/4] util: print errno in virObjectLockableNew

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

 



In virObjectLockableNew, when virMutexInit fails,
virReportSystemError should use errno to get the right
error number, instead of VIR_ERR_INTERNAL_ERROR.

Signed-off-by: Jincheng Miao <jmiao@xxxxxxxxxx>
---
 src/util/virobject.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virobject.c b/src/util/virobject.c
index 6cb84b4..b5d2c02 100644
--- a/src/util/virobject.c
+++ b/src/util/virobject.c
@@ -220,7 +220,7 @@ void *virObjectLockableNew(virClassPtr klass)
         return NULL;
 
     if (virMutexInit(&obj->lock) < 0) {
-        virReportSystemError(VIR_ERR_INTERNAL_ERROR, "%s",
+        virReportSystemError(errno, "%s",
                              _("Unable to initialize mutex"));
         virObjectUnref(obj);
         return NULL;
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]