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@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
This commit is contained in:
Jan Beulich committed 2022-01-04 10:20:15 +01:00
1 parent 7cd0a787bb
commit 78688ffa7e
1 file changed
-4
-4
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.