From c1058b29cb1e5997b94ec6418a360d00106f257e Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Tue, 3 May 2016 12:55:07 +0200 Subject: [PATCH] tools/xsplice: fix mixing system errno values with Xen ones. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Avoid using system errno values when comparing with Xen errno values. Signed-off-by: Roger Pau Monné Acked-by: Wei Liu Reviewed-by: Konrad Rzeszutek Wilk Release-acked-by: Wei Liu --- tools/misc/xen-xsplice.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c index 4b23de6009..ddaa07911d 100644 --- a/tools/misc/xen-xsplice.c +++ b/tools/misc/xen-xsplice.c @@ -13,6 +13,8 @@ #include #include +#include + static xc_interface *xch; void show_help(void) @@ -233,7 +235,7 @@ struct { .function = xc_xsplice_revert, }, { .allow = XSPLICE_STATE_CHECKED, - .expected = -ENOENT, + .expected = -XEN_ENOENT, .name = "unload", .function = xc_xsplice_unload, }, @@ -276,7 +278,7 @@ int action_func(int argc, char *argv[], unsigned int idx) name, errno, strerror(errno)); return -1; } - if ( status.rc == -EAGAIN ) + if ( status.rc == -XEN_EAGAIN ) { fprintf(stderr, "%s failed. Operation already in progress\n", name); return -1; @@ -319,7 +321,7 @@ int action_func(int argc, char *argv[], unsigned int idx) if ( status.state != original_state ) break; - if ( status.rc && status.rc != -EAGAIN ) + if ( status.rc && status.rc != -XEN_EAGAIN ) { rc = status.rc; break; -- 2.30.2