Skip to content

Commit

Permalink
conf: setup_mount()
Browse files Browse the repository at this point in the history
non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner authored and stgraber committed Aug 15, 2017
1 parent c75b0ed commit cee8783
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/lxc/conf.c
Expand Up @@ -1975,23 +1975,25 @@ static int mount_file_entries(const struct lxc_rootfs *rootfs, FILE *file,
}

static int setup_mount(const struct lxc_rootfs *rootfs, const char *fstab,
const char *lxc_name, const char *lxc_path)
const char *lxc_name, const char *lxc_path)
{
FILE *file;
FILE *f;
int ret;

if (!fstab)
return 0;

file = setmntent(fstab, "r");
if (!file) {
SYSERROR("failed to use '%s'", fstab);
f = setmntent(fstab, "r");
if (!f) {
SYSERROR("Failed to open \"%s\"", fstab);
return -1;
}

ret = mount_file_entries(rootfs, file, lxc_name, lxc_path);
ret = mount_file_entries(rootfs, f, lxc_name, lxc_path);
if (ret < 0)
ERROR("Failed to set up mount entries");

endmntent(file);
endmntent(f);
return ret;
}

Expand Down

0 comments on commit cee8783

Please sign in to comment.