logind: propagate session stop errors
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Aug 2018 17:35:44 +0000 (19:35 +0200)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Fri, 20 Aug 2021 11:06:37 +0000 (13:06 +0200)
Let's propagate errors from stopping sessions via seat_stop(). This is
similar to how we propagate such errors in user_stop() for all sessions
associated with a user.

Note that we propagate these errors, but we don't abort the function.

(cherry picked from commit e6958b7ea33813b085966ac25817a957c0dad7f9)

Related: #1642460

src/login/logind-seat.c

index 9e4f009643a0585c087a46008260d412af3abce4..96c34a6c9e8da939a30024a4d9a8a3a91dcffce3 100644 (file)
@@ -431,7 +431,7 @@ int seat_start(Seat *s) {
 }
 
 int seat_stop(Seat *s, bool force) {
-        int r = 0;
+        int r;
 
         assert(s);
 
@@ -441,7 +441,7 @@ int seat_stop(Seat *s, bool force) {
                            "SEAT_ID=%s", s->id,
                            LOG_MESSAGE("Removed seat %s.", s->id));
 
-        seat_stop_sessions(s, force);
+        r = seat_stop_sessions(s, force);
 
         unlink(s->state_file);
         seat_add_to_gc_queue(s);