summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-07-20 11:14:18 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-20 11:14:18 +0200
commit801a884d1ec66d8174b0e6dd9834f69165da94b5 (patch)
tree4ee6261b7384b4ca387b8cabfc07e31faf5f820b
parent13317a22e5cf8f7c458616a971e60e84255bc364 (diff)
logind: minor coding style improvements
-rw-r--r--src/login/logind-session.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 1e0666884a..0b917c23e1 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -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;