[PATCH] virhook: do not save the return value of virBuildPath

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

 



This function returns -1 on allocation error, there's no
need to check the path for NULL again.
---
 src/util/virhook.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/virhook.c b/src/util/virhook.c
index ee19382..ba50598 100644
--- a/src/util/virhook.c
+++ b/src/util/virhook.c
@@ -119,8 +119,7 @@ virHookCheck(int no, const char *driver)
         return -1;
     }
 
-    ret = virBuildPath(&path, LIBVIRT_HOOK_DIR, driver);
-    if ((ret < 0) || (path == NULL)) {
+    if (virBuildPath(&path, LIBVIRT_HOOK_DIR, driver) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to build path for %s hook"),
                        driver);
@@ -276,8 +275,7 @@ virHookCall(int driver,
     if (extra == NULL)
         extra = "-";
 
-    ret = virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr);
-    if ((ret < 0) || (path == NULL)) {
+    if (virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Failed to build path for %s hook"),
                        drvstr);
-- 
2.4.10

--
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]