[CRIU] [PATCH 01/10] test: static/mnt_ext_auto -- Check if unshare successed

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


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

diff --git a/test/zdtm/static/mnt_ext_auto.c b/test/zdtm/static/mnt_ext_auto.c
index 947ea00cb9d8..9181b370af72 100644
--- a/test/zdtm/static/mnt_ext_auto.c
+++ b/test/zdtm/static/mnt_ext_auto.c
@@ -66,7 +66,10 @@ int main(int argc, char ** argv)
 	}
 	mkdir(src, 755);
 
-	unshare(CLONE_NEWNS);
+	if (unshare(CLONE_NEWNS)) {
+		pr_perror("unshare");
+		return 1;
+	}
 	mkdir(dst, 755);
 	if (mount(src, dst, NULL, MS_BIND, NULL)) {
 		pr_perror("bind");
-- 
2.17.1



More information about the CRIU mailing list