[CRIU] [PATCH 03/10] test: static/mntns_root_bind -- Check if unshare successed

Cyrill Gorcunov gorcunov at gmail.com
Wed Sep 19 14:50:29 MSK 2018


Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 test/zdtm/static/mntns_root_bind.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/static/mntns_root_bind.c b/test/zdtm/static/mntns_root_bind.c
index 978143ec2724..86c44e19752e 100644
--- a/test/zdtm/static/mntns_root_bind.c
+++ b/test/zdtm/static/mntns_root_bind.c
@@ -64,7 +64,10 @@ int main(int argc, char **argv)
 		return 1;
 	}
 	if (pid == 0) {
-		unshare(CLONE_NEWNS);
+		if (unshare(CLONE_NEWNS)) {
+			pr_perror("unshare");
+			return 1;
+		}
 		if (mount(path, bpath, NULL, MS_BIND, NULL)) {
 			pr_perror("mount");
 			return 1;
-- 
2.17.1



More information about the CRIU mailing list