[CRIU] [PATCH 08/10] test: static/tun -- Check if unshare successed

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


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

diff --git a/test/zdtm/static/tun.c b/test/zdtm/static/tun.c
index 98519e5d22cf..c38ac4836e6d 100644
--- a/test/zdtm/static/tun.c
+++ b/test/zdtm/static/tun.c
@@ -120,7 +120,10 @@ int main(int argc, char **argv)
 
 	test_init(argc, argv);
 #ifdef TUN_NS
-	unshare(CLONE_NEWNET);
+	if (unshare(CLONE_NEWNET)) {
+		pr_perror("unshare");
+		return 1;
+	}
 	system("ip link set up dev lo");
 #endif
 	/* fd[0] -- opened file */
-- 
2.17.1



More information about the CRIU mailing list