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

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

Details

Message ID 20180919115036.12934-2-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_auto.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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");