[CRIU] [PATCH] cr-service: fix return result for not supported cpuinfo

Adrian Reber adrian at lisas.de
Thu Nov 5 06:18:34 PST 2015


From: Adrian Reber <areber at redhat.com>

The change to fill out cr_errno if cpuinfo dump/check failed
in the previous patch 7e862bb3f3b27072cad5f0a4e374ec4c0d7b12fa
was returning (-ENOTSUP & 0xff). To easier check for
the return result this is now changed to just return ENOTSUP.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 cr-service.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cr-service.c b/cr-service.c
index 599aab7..6e1b4c7 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -842,7 +842,11 @@ cout:
 	switch (WEXITSTATUS(status)) {
 	case (-ENOTSUP & 0xff):
 		resp.has_cr_errno = 1;
-		resp.cr_errno = WEXITSTATUS(status);
+		/*
+		 * Let's return the actual error code and
+		 * not just (-ENOTSUP & 0xff)
+		 */
+		resp.cr_errno = ENOTSUP;
 		break;
 	case 0:
 		success = true;
-- 
1.8.3.1



More information about the CRIU mailing list