Message ID | 20220420073119.16974-3-jgross@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | tools/libs: don't set errno to negative values | expand |
On 20/04/2022 08:31, Juergen Gross wrote: > The claimed reason for setting errno to -1 is wrong. On x86 > xc_domain_pod_target() will set errno to a sane value in the error > case. Fixes: ff1745d5882b > Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c index ef62f66009..71608c00e9 100644 --- a/tools/libs/ctrl/xc_domain.c +++ b/tools/libs/ctrl/xc_domain.c @@ -1293,9 +1293,7 @@ int xc_domain_get_pod_target(xc_interface *xch, uint64_t *pod_cache_pages, uint64_t *pod_entries) { - /* On x86 (above) xc_domain_pod_target will incorrectly return -1 - * with errno==-1 on error. Do the same for least surprise. */ - errno = -1; + errno = EOPNOTSUPP; return -1; } #endif
The claimed reason for setting errno to -1 is wrong. On x86 xc_domain_pod_target() will set errno to a sane value in the error case. Signed-off-by: Juergen Gross <jgross@suse.com> --- tools/libs/ctrl/xc_domain.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)