From: Andy Wingo Date: Sun, 6 Mar 2016 15:56:33 +0000 (+0100) Subject: Fixes to user and session saving X-Git-Tag: v226.4~6 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b5c5dd2ad43a3bf4fa0fb21139f8d16959b5d14e;p=elogind.git Fixes to user and session saving * src/login/logind-dbus.c (method_create_session): No need to save session here, as session_send_create_reply will do it. * src/login/logind-session-dbus.c (session_send_create_reply): On the other hand we do need to save the user here, so the file marks them as being active. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 5e6952de0..6f7e5692a 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -801,8 +801,6 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use if (r < 0) goto fail; - session_save(session); - return 1; fail: diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index f71798b20..337bbbbe8 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -721,9 +721,10 @@ int session_send_create_reply(Session *s, sd_bus_error *error) { if (fifo_fd < 0) return fifo_fd; - /* Update the session state file before we notify the client - * about the result. */ + /* Update the session and user state files before we notify + * the client about the result. */ session_save(s); + user_save(s->user); p = session_bus_path(s); if (!p)