Commit b8c93feb authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

file: use ralative path for retoring files

openat() is used to open files, so absolute pathes can't be used

v2: change the comment
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 85b3d86e
......@@ -915,9 +915,14 @@ struct file_desc *collect_special_file(u32 id)
static int collect_one_regfile(void *o, ProtobufCMessage *base)
{
struct reg_file_info *rfi = o;
static char dot[] = ".";
rfi->rfe = pb_msg(base, RegFileEntry);
rfi->path = rfi->rfe->name;
/* change "/foo" into "foo" and "/" into "." */
if (rfi->rfe->name[1] == '\0')
rfi->path = dot;
else
rfi->path = rfi->rfe->name + 1;
rfi->remap = NULL;
rfi->size_checked = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment