[CRIU] [PATCH 06/10] test: static/sk-unix-mntns -- Check if unshare successed

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


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

diff --git a/test/zdtm/static/sk-unix-mntns.c b/test/zdtm/static/sk-unix-mntns.c
index 84e65ee13ac7..58f63797a81e 100644
--- a/test/zdtm/static/sk-unix-mntns.c
+++ b/test/zdtm/static/sk-unix-mntns.c
@@ -53,7 +53,10 @@ int main(int argc, char *argv[])
 	}
 
 	if (pid == 0) {
-		unshare(CLONE_NEWNS);
+		if (unshare(CLONE_NEWNS)) {
+			pr_perror("unshare");
+			return 1;
+		}
 		if (mount(NULL, "/", NULL, MS_PRIVATE | MS_REC, NULL)) {
 			pr_perror("mount");
 			return 1;
-- 
2.17.1



More information about the CRIU mailing list