criu: return original error code from bc_failcnt_check() if failed

Submitted by Stanislav Kinsburskiy on Jan. 4, 2018, 11:58 a.m.

Details

Message ID 20180104115823.36582.59897.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "criu: return original error code from bc_failcnt_check() if failed"
Headers show

Commit Message

Stanislav Kinsburskiy Jan. 4, 2018, 11:58 a.m.
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@virtuozzo.com>
---
 criu/cr-restore.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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)) {