logind,machined: various smaller cleanups
Use mfree() where we can.
Drop unnecessary {}.
Drop unnecessary variable declarations.
Cast syscall invocations where explicitly don't care for the return
value to (void).
Reword a comment.
This commit is contained in:
@@ -231,11 +231,11 @@ static void machine_unlink(Machine *m) {
|
||||
char *sl;
|
||||
|
||||
sl = strjoina("/run/systemd/machines/unit:", m->unit);
|
||||
unlink(sl);
|
||||
(void) unlink(sl);
|
||||
}
|
||||
|
||||
if (m->state_file)
|
||||
unlink(m->state_file);
|
||||
(void) unlink(m->state_file);
|
||||
}
|
||||
|
||||
int machine_load(Machine *m) {
|
||||
|
||||
@@ -1124,8 +1124,7 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err
|
||||
return 0;
|
||||
|
||||
if (streq_ptr(path, machine->scope_job)) {
|
||||
free(machine->scope_job);
|
||||
machine->scope_job = NULL;
|
||||
machine->scope_job = mfree(machine->scope_job);
|
||||
|
||||
if (machine->started) {
|
||||
if (streq(result, "done"))
|
||||
|
||||
Reference in New Issue
Block a user