[CRIU] [PATCH v2 02/36] files: Do not lost original errno value
Kirill Tkhai
ktkhai at virtuozzo.com
Fri Feb 3 08:11:54 PST 2017
The callers of rfi_remap() are interested in a errno,
linkat_hard() returns. So, preserve errno before we
call rm_parent_dirs().
Reported-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/files-reg.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/criu/files-reg.c b/criu/files-reg.c
index e8d74a691..df270a646 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1419,7 +1419,9 @@ static int rfi_remap(struct reg_file_info *rfi, int *level)
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;
}
More information about the CRIU
mailing list