goto finish;
}
+ free(temp_path);
+ temp_path = NULL;
+
if (m->unit) {
char *sl;
/* Create a symlink from the unit name to the machine
* name, so that we can quickly find the machine for
* each given unit */
- sl = strappenda("/run/systemd/machines/unit:", m->unit);
+ sl = strjoina("/run/systemd/machines/unit:", m->unit);
symlink(m->name, sl);
}
finish:
- if (r < 0) {
- if (temp_path)
- unlink(temp_path);
+ if (temp_path)
+ unlink(temp_path);
+ if (r < 0)
log_error_errno(r, "Failed to save machine data %s: %m", m->state_file);
- }
return r;
}
char *sl;
- sl = strappenda("/run/systemd/machines/unit:", m->unit);
+ sl = strjoina("/run/systemd/machines/unit:", m->unit);
unlink(sl);
}
if (!scope)
return log_oom();
- description = strappenda(m->class == MACHINE_VM ? "Virtual Machine " : "Container ", m->name);
+ description = strjoina(m->class == MACHINE_VM ? "Virtual Machine " : "Container ", m->name);
r = manager_start_scope(m->manager, scope, m->leader, SPECIAL_MACHINE_SLICE, description, properties, error, &job);
if (r < 0) {