mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
Fix lxc syntax-check failure
Fixes: CHECK: avoid_if_before_free src/lxc_container.c: if (oldroot) VIR_FREE(oldroot) src/lxc_container.c: if (newroot) VIR_FREE(newroot) Makefile.maint: found useless "if" before "free" above and: src/lxc_container.c:317: Makefile.maint: found trailing blank(s) Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
parent
316befbb0c
commit
169afbe9aa
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 16 14:05:28 GMT 2009 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* src/lxc_container.c: syntax-check fixes
|
||||||
|
|
||||||
Wed Apr 15 22:40:50 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
Wed Apr 15 22:40:50 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* docs/Makefile.am docs/api.html docs/api.html.in docs/archdomain.html
|
* docs/Makefile.am docs/api.html docs/api.html.in docs/archdomain.html
|
||||||
|
@ -282,9 +282,11 @@ static int lxcContainerChildMountSort(const void *a, const void *b)
|
|||||||
|
|
||||||
static int lxcContainerPivotRoot(virDomainFSDefPtr root)
|
static int lxcContainerPivotRoot(virDomainFSDefPtr root)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc, ret;
|
||||||
char *oldroot = NULL, *newroot = NULL;
|
char *oldroot = NULL, *newroot = NULL;
|
||||||
|
|
||||||
|
ret = -1;
|
||||||
|
|
||||||
/* root->parent must be private, so make / private. */
|
/* root->parent must be private, so make / private. */
|
||||||
if (mount("", "/", NULL, MS_PRIVATE|MS_REC, NULL) < 0) {
|
if (mount("", "/", NULL, MS_PRIVATE|MS_REC, NULL) < 0) {
|
||||||
virReportSystemError(NULL, errno, "%s",
|
virReportSystemError(NULL, errno, "%s",
|
||||||
@ -366,15 +368,13 @@ static int lxcContainerPivotRoot(virDomainFSDefPtr root)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
|
err:
|
||||||
VIR_FREE(oldroot);
|
VIR_FREE(oldroot);
|
||||||
VIR_FREE(newroot);
|
VIR_FREE(newroot);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
|
|
||||||
err:
|
|
||||||
if (oldroot) VIR_FREE(oldroot);
|
|
||||||
if (newroot) VIR_FREE(newroot);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lxcContainerPopulateDevices(void)
|
static int lxcContainerPopulateDevices(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user