Commit a80aba14 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

files: Do not lost original errno value

The callers of rfi_remap() are interested in a errno,
linkat_hard() returns. So, preserve errno before we
call rm_parent_dirs().
Reported-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 1c478a2e
......@@ -1418,7 +1418,9 @@ out_root:
if (linkat_hard(mntns_root, rpath, mntns_root, path,
rfi->remap->uid, rfi->remap->gid, 0) < 0) {
int errno_saved = errno;
rm_parent_dirs(mntns_root, path, *level);
errno = errno_saved;
return -1;
}
......
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