[CRIU] [PATCH] fs: Don't hide error from prepare_fs

Pavel Emelyanov xemul at parallels.com
Mon Jun 9 05:50:05 PDT 2014


If fchroot() succeeds the further failures don't get
noticed by caller.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 files.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/files.c b/files.c
index 991d4a2..a8cd87f 100644
--- a/files.c
+++ b/files.c
@@ -1020,7 +1020,7 @@ static int fchroot(int fd)
 
 int prepare_fs(int pid)
 {
-	int ifd, dd, ret = -1;
+	int ifd, dd, ret, err = -1;
 	FsEntry *fe;
 
 	ifd = open_image(CR_FD_FS, O_RSTR, pid);
@@ -1069,13 +1069,13 @@ int prepare_fs(int pid)
 		umask(fe->umask);
 	}
 
-	ret = 0;
+	err = 0;
 err:
 	fs_entry__free_unpacked(fe, NULL);
 out_i:
 	close_safe(&ifd);
 out:
-	return ret;
+	return err;
 }
 
 int shared_fdt_prepare(struct pstree_item *item)
-- 
1.8.4.2


More information about the CRIU mailing list