chiark / gitweb /
logind: Avoid unnecesary rewrite of user file when switching sessions of the same...
[elogind.git] / src / login / logind-seat.c
index 937315e..c2cf6e5 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;