1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

logind: minor coding style improvements

This commit is contained in:
Lennart Poettering 2016-07-20 11:14:18 +02:00
parent 13317a22e5
commit 801a884d1e

View File

@ -603,7 +603,6 @@ int session_start(Session *s) {
static int session_stop_scope(Session *s, bool force) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
char *job = NULL;
int r;
assert(s);
@ -612,20 +611,18 @@ static int session_stop_scope(Session *s, bool force) {
return 0;
if (force || manager_shall_kill(s->manager, s->user->name)) {
char *job = NULL;
r = manager_stop_unit(s->manager, s->scope, &error, &job);
if (r < 0) {
log_error("Failed to stop session scope: %s", bus_error_message(&error, r));
return r;
}
if (r < 0)
return log_error_errno(r, "Failed to stop session scope: %s", bus_error_message(&error, r));
free(s->scope_job);
s->scope_job = job;
} else {
r = manager_abandon_scope(s->manager, s->scope, &error);
if (r < 0) {
log_error("Failed to abandon session scope: %s", bus_error_message(&error, r));
return r;
}
if (r < 0)
return log_error_errno(r, "Failed to abandon session scope: %s", bus_error_message(&error, r));
}
return 0;