[CRIU] [PATCH 2/4] mount: return a relative path from cut_root_for_bind()

Andrey Vagin avagin at openvz.org
Thu May 12 15:34:55 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

static char *cut_root_for_bind(char *target_root, char *source_root)

Currently it returns a relative path if source_root is '/' and
an absolute path for other cases.

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/mount.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/criu/mount.c b/criu/mount.c
index eb7e234..f38ba1c 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -808,6 +808,8 @@ static char *cut_root_for_bind(char *target_root, char *source_root)
 			break;
 		BUG_ON(target_root[tok] == '\0');
 	}
+	if (target_root[tok] == '/')
+		tok++;
 
 	return target_root + tok;
 
-- 
2.7.4



More information about the CRIU mailing list