chiark / gitweb /
logind: Avoid unnecesary rewrite of user file when switching sessions of the same...
authorColin Guthrie <colin@mageia.org>
Tue, 4 Sep 2012 00:37:28 +0000 (01:37 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 12 Sep 2012 06:20:01 +0000 (08:20 +0200)
src/login/logind-seat.c

index 937315ebf1ab17c4fa8a9b0ab61003c784451ed4..c2cf6e5e137147c5e07c18d92e7d88103b3b09ce 100644 (file)
@@ -263,7 +263,8 @@ int seat_set_active(Seat *s, Session *session) {
 
         if (old_active) {
                 session_save(old_active);
-                user_save(old_active->user);
+                if (!session || session->user != old_active->user)
+                        user_save(old_active->user);
         }
 
         return 0;