]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: __lxc_start return -1 when start fails 2785/head
authorLiFeng <lifeng68@huawei.com>
Tue, 15 Jan 2019 12:25:00 +0000 (07:25 -0500)
committerLiFeng <lifeng68@huawei.com>
Tue, 15 Jan 2019 12:25:00 +0000 (07:25 -0500)
Signed-off-by: LiFeng <lifeng68@huawei.com>
src/lxc/start.c

index 49c2018cacd192633b54035355b258b89f8c6969..91f1e51b7ff90bd28a11a04d6685361310086a0d 100644 (file)
@@ -1940,16 +1940,19 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
 
        if (!attach_block_device(handler->conf)) {
                ERROR("Failed to attach block device");
+               ret = -1;
                goto out_fini_nonet;
        }
 
        if (!cgroup_ops->monitor_create(cgroup_ops, handler)) {
                ERROR("Failed to create monitor cgroup");
+               ret = -1;
                goto out_fini_nonet;
        }
 
        if (!cgroup_ops->monitor_enter(cgroup_ops, handler->monitor_pid)) {
                ERROR("Failed to enter monitor cgroup");
+               ret = -1;
                goto out_fini_nonet;
        }
 
@@ -1994,6 +1997,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
 
        if (!handler->init_died && handler->pid > 0) {
                ERROR("Child process is not killed");
+               ret = -1;
                goto out_abort;
        }