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

[xen staging] libxc: avoid clobbering errno in xc_domain_pod_target()



commit 78688ffa7e86e7cdb57d383e213fd822aaaa5438
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jan 4 10:20:15 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jan 4 10:20:15 2022 +0100

    libxc: avoid clobbering errno in xc_domain_pod_target()
    
    do_memory_op() supplies return value and has "errno" set the usual way.
    Don't overwrite "errno" with 1 (aka EPERM on at least Linux). There's
    also no reason to overwrite "err".
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
---
 tools/libs/ctrl/xc_domain.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 20b86d986c..ef62f66009 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1230,13 +1230,9 @@ static int xc_domain_pod_target(xc_interface *xch,
     err = do_memory_op(xch, op, &pod_target, sizeof(pod_target));
 
     if ( err < 0 )
-    {
         DPRINTF("Failed %s_pod_target dom %d\n",
                 (op==XENMEM_set_pod_target)?"set":"get",
                 domid);
-        errno = -err;
-        err = -1;
-    }
     else
         err = 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.