Commit 7aa7e95f authored by Pavel Emelyanov's avatar Pavel Emelyanov

fs: Don't hide error from prepare_fs

If fchroot() succeeds the further failures don't get
noticed by caller.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
parent bd7bddb8
...@@ -1020,7 +1020,7 @@ static int fchroot(int fd) ...@@ -1020,7 +1020,7 @@ static int fchroot(int fd)
int prepare_fs(int pid) int prepare_fs(int pid)
{ {
int ifd, dd, ret = -1; int ifd, dd, ret, err = -1;
FsEntry *fe; FsEntry *fe;
ifd = open_image(CR_FD_FS, O_RSTR, pid); ifd = open_image(CR_FD_FS, O_RSTR, pid);
...@@ -1069,13 +1069,13 @@ int prepare_fs(int pid) ...@@ -1069,13 +1069,13 @@ int prepare_fs(int pid)
umask(fe->umask); umask(fe->umask);
} }
ret = 0; err = 0;
err: err:
fs_entry__free_unpacked(fe, NULL); fs_entry__free_unpacked(fe, NULL);
out_i: out_i:
close_safe(&ifd); close_safe(&ifd);
out: out:
return ret; return err;
} }
int shared_fdt_prepare(struct pstree_item *item) int shared_fdt_prepare(struct pstree_item *item)
......
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