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>
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");
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);
}