[02/10] test: static/mnt_ext_master -- Check if unshare successed

Submitted by Cyrill Gorcunov on Sept. 19, 2018, 11:50 a.m.

Details

Message ID 20180919115036.12934-3-gorcunov@gmail.com
State Accepted
Series "tests: Add testing for unshare codes and tun rework"
Headers show

Commit Message

Cyrill Gorcunov Sept. 19, 2018, 11:50 a.m.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 test/zdtm/static/mnt_ext_master.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/mnt_ext_master.c b/test/zdtm/static/mnt_ext_master.c
index f2c8e38d4e90..12e9ebab113a 100644
--- a/test/zdtm/static/mnt_ext_master.c
+++ b/test/zdtm/static/mnt_ext_master.c
@@ -43,7 +43,10 @@  int main(int argc, char ** argv)
 	mkdir(src, 755);
 	mkdir(dst, 755);
 
-	unshare(CLONE_NEWNS);
+	if (unshare(CLONE_NEWNS)) {
+		pr_perror("unshare");
+		return 1;
+	}
 
 	if (mount(src, dst, NULL, MS_BIND, NULL)) {
 		pr_perror("bind");