]> err.no Git - systemd/commitdiff
logind: save object data only when started fully
authorLennart Poettering <lennart@poettering.net>
Mon, 27 Jun 2011 21:06:34 +0000 (23:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 27 Jun 2011 21:06:34 +0000 (23:06 +0200)
src/logind-seat.c
src/logind-session.c
src/logind-user.c

index c232a87d5de8effd1b51b09971f569c5b4791f43..df91cd0d8a53ebc057dd77a197bc84e11be8953c 100644 (file)
@@ -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;
index 9fcbf460a3a2f40fdccbb7016dfa8cc0c3010a43..cbde8105020435fba55708ae50fcb10c834565f4 100644 (file)
@@ -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;
index dff317e6bda267323dc97ce90b0b1465f39f364c..a4f78869a31d1078342fdaa847c5ab506b537448 100644 (file)
@@ -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;