From patchwork Thu Jan 4 11:58:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: criu: return original error code from bc_failcnt_check() if failed From: Stanislav Kinsburskiy X-Patchwork-Id: 7159 Message-Id: <20180104115823.36582.59897.stgit@skinsbursky-vz7.qa.sw.ru> To: Date: Thu, 4 Jan 2018 14:58:27 +0300 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 --- 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)) {