From: Lennart Poettering Date: Mon, 27 Jun 2011 21:06:34 +0000 (+0200) Subject: logind: save object data only when started fully X-Git-Tag: v30~140 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=accaeded150b13685b188ea69f4b608d3cfa5463;p=systemd logind: save object data only when started fully --- diff --git a/src/logind-seat.c b/src/logind-seat.c index c232a87d..df91cd0d 100644 --- a/src/logind-seat.c +++ b/src/logind-seat.c @@ -86,6 +86,9 @@ int seat_save(Seat *s) { assert(s); + if (!s->started) + return 0; + r = safe_mkdir("/run/systemd/seats", 0755, 0, 0); if (r < 0) goto finish; diff --git a/src/logind-session.c b/src/logind-session.c index 9fcbf460..cbde8105 100644 --- a/src/logind-session.c +++ b/src/logind-session.c @@ -111,6 +111,9 @@ int session_save(Session *s) { assert(s); + if (!s->started) + return 0; + r = safe_mkdir("/run/systemd/sessions", 0755, 0, 0); if (r < 0) goto finish; diff --git a/src/logind-user.c b/src/logind-user.c index dff317e6..a4f78869 100644 --- a/src/logind-user.c +++ b/src/logind-user.c @@ -94,6 +94,9 @@ int user_save(User *u) { assert(u); assert(u->state_file); + if (!u->started) + return 0; + r = safe_mkdir("/run/systemd/users", 0755, 0, 0); if (r < 0) goto finish;