[Devel] [PATCH] criu: return original error code from bc_failcnt_check() if failed

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Jan 4 14:58:27 MSK 2018


Currently this helper doesn't see "/proc/bc/%s/resources" (another mount ns?).
But this leads to a situation, when error is swallowed by the helper.
I.e. it returns 0 even if there was an error during restore.
So, let's return original error code instead.

https://jira.sw.ru/browse/PSBM-80056

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/cr-restore.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index bd36523..6337c0f 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2034,7 +2034,7 @@ static int bc_failcnt_check(int ret)
 	snprintf(buf, sizeof(buf), "/proc/bc/%s/resources", veid);
 	f = fopen(buf, "r");
 	if (!f) {
-		return 0;
+		return ret;
 	}
 	
 	while (fgets(buf, sizeof(buf), f)) {



More information about the Devel mailing list