[03/10] test: static/mntns_root_bind -- Check if unshare successed

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

Details

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

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/mntns_root_bind.c b/test/zdtm/static/mntns_root_bind.c
index 978143ec2724..86c44e19752e 100644
--- a/test/zdtm/static/mntns_root_bind.c
+++ b/test/zdtm/static/mntns_root_bind.c
@@ -64,7 +64,10 @@  int main(int argc, char **argv)
 		return 1;
 	}
 	if (pid == 0) {
-		unshare(CLONE_NEWNS);
+		if (unshare(CLONE_NEWNS)) {
+			pr_perror("unshare");
+			return 1;
+		}
 		if (mount(path, bpath, NULL, MS_BIND, NULL)) {
 			pr_perror("mount");
 			return 1;