[PATCH v4 14/15] parallels: fix getJobResultHelper

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

 



When PrlJob_GetRetCode sets second argument to
error value it means sdk function failed and we
must return error from getJobResultHelper.

Signed-off-by: Dmitry Guryanov <dguryanov@xxxxxxxxxxxxx>
---
 src/parallels/parallels_sdk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index ad0bda1..d183994 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -161,6 +161,7 @@ getJobResultHelper(PRL_HANDLE job, unsigned int timeout, PRL_HANDLE *result,
             logPrlErrorHelper(retCode, filename, funcname, linenr);
 
         PrlHandle_Free(err_handle);
+        ret = retCode;
     } else {
         ret = PrlJob_GetResult(job, result);
         if (PRL_FAILED(ret)) {
@@ -169,8 +170,9 @@ getJobResultHelper(PRL_HANDLE job, unsigned int timeout, PRL_HANDLE *result,
             *result = NULL;
             goto cleanup;
         }
+
+        ret = PRL_ERR_SUCCESS;
     }
-    ret = PRL_ERR_SUCCESS;
 
  cleanup:
     PrlHandle_Free(job);
-- 
1.9.3

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