conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2017-04-22 13:22:16 +02:00
parent dc46df1e42
commit d435aae15b
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -590,10 +590,9 @@ static int mount_rootfs_dir(const char *rootfs, const char *target,
return ret; return ret;
} }
static int setup_lodev(const char *rootfs, int fd, struct loop_info64 *loinfo) static int lxc_setup_lodev(const char *rootfs, int fd, struct loop_info64 *loinfo)
{ {
int rfd; int rfd;
int ret = -1;
rfd = open(rootfs, O_RDWR); rfd = open(rootfs, O_RDWR);
if (rfd < 0) { if (rfd < 0) {
@ -603,23 +602,20 @@ static int setup_lodev(const char *rootfs, int fd, struct loop_info64 *loinfo)
memset(loinfo, 0, sizeof(*loinfo)); memset(loinfo, 0, sizeof(*loinfo));
loinfo->lo_flags = LO_FLAGS_AUTOCLEAR;
if (ioctl(fd, LOOP_SET_FD, rfd)) { if (ioctl(fd, LOOP_SET_FD, rfd)) {
SYSERROR("failed to LOOP_SET_FD"); SYSERROR("failed to LOOP_SET_FD");
goto out; close(rfd);
return -1;
} }
loinfo->lo_flags = LO_FLAGS_AUTOCLEAR;
if (ioctl(fd, LOOP_SET_STATUS64, loinfo)) { if (ioctl(fd, LOOP_SET_STATUS64, loinfo)) {
SYSERROR("failed to LOOP_SET_STATUS64"); SYSERROR("failed to LOOP_SET_STATUS64");
goto out; close(rfd);
return -1;
} }
ret = 0; return 0;
out:
close(rfd);
return ret;
} }
static int mount_rootfs_file(const char *rootfs, const char *target, static int mount_rootfs_file(const char *rootfs, const char *target,
@ -627,9 +623,9 @@ static int mount_rootfs_file(const char *rootfs, const char *target,
{ {
struct dirent *direntp; struct dirent *direntp;
struct loop_info64 loinfo; struct loop_info64 loinfo;
int ret = -1, fd = -1, rc;
DIR *dir; DIR *dir;
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int ret = -1, fd = -1, rc;
dir = opendir("/dev"); dir = opendir("/dev");
if (!dir) { if (!dir) {
@ -673,7 +669,7 @@ static int mount_rootfs_file(const char *rootfs, const char *target,
DEBUG("found '%s' free lodev", path); DEBUG("found '%s' free lodev", path);
ret = setup_lodev(rootfs, fd, &loinfo); ret = lxc_setup_lodev(rootfs, fd, &loinfo);
if (!ret) if (!ret)
ret = mount_unknown_fs(path, target, options); ret = mount_unknown_fs(path, target, options);
close(fd); close(fd);