We should be using the errno that the hypercall left
instead of overwriting it with the return value.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
int rc;
rc = xc_get_machine_memory_map(CTX->xch, map, *nr);
- if (rc < 0) {
- errno = rc;
+ if (rc < 0)
return ERROR_FAIL;
- }
*nr = rc;
rc = xc_domain_set_memory_map(ctx->xch, domid, map, nr);
- if (rc < 0) {
- errno = rc;
+ if (rc < 0)
return ERROR_FAIL;
- }
+
return 0;
}