]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgm_destroy: ignore a NULL d->cgroup_path
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 10 Mar 2014 16:59:08 +0000 (11:59 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 10 Mar 2014 17:02:58 +0000 (13:02 -0400)
Depending on where during container creation we failed, cgroup_path
may be NULL.  Don't try to delete the cgroup in that case.

(Also fix a wrong function name in an ERROR message)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgmanager.c

index c80a136e5d6665a2b627854005a9e6d22ca4e932..4795da43a8a76a95c2c79c3f65f7a3a58f95f092 100644 (file)
@@ -438,7 +438,7 @@ static void cgm_destroy(void *hdata)
        struct cgm_data *d = hdata;
        int i;
 
-       if (!d)
+       if (!d || !d->cgroup_path)
                return;
        if (!cgm_dbus_connect()) {
                ERROR("Error connecting to cgroup manager");
@@ -703,7 +703,7 @@ static int cgm_do_set(const char *controller, const char *file,
        if (ret != 0) {
                NihError *nerr;
                nerr = nih_error_get();
-               ERROR("call to cgmanager_remove_sync failed: %s", nerr->message);
+               ERROR("call to cgmanager_set_value_sync failed: %s", nerr->message);
                nih_free(nerr);
                ERROR("Error setting cgroup %s limit %s", file, cgroup);
        }