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:
Lennart Poettering
2015-08-06 16:54:00 +03:00
parent 65d73cf042
commit 491ac9f2c4
5 changed files with 15 additions and 25 deletions
+2 -2
View File
@@ -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) {
+1 -2
View File
@@ -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"))