X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-session.c;h=a02a537f7ca00666a2316ec357408d84d2323c32;hb=b44787bd437f4051660272b37bd6f75392f17931;hp=a51f9f3e0fccd2c040e6c6db9cbf32add41941ed;hpb=8cb4ab0058e51f1fba93683d145ef95f97c2fa86;p=elogind.git diff --git a/src/login/logind-session.c b/src/login/logind-session.c index a51f9f3e0..a02a537f7 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -301,6 +301,7 @@ int session_load(Session *s) { _cleanup_free_ char *remote = NULL, *seat = NULL, *vtnr = NULL, + *state = NULL, *pos = NULL, *leader = NULL, *type = NULL, @@ -327,6 +328,7 @@ int session_load(Session *s) { "SERVICE", &s->service, "DESKTOP", &s->desktop, "VTNR", &vtnr, + "STATE", &state, "POS", &pos, "LEADER", &leader, "TYPE", &type, @@ -415,13 +417,18 @@ int session_load(Session *s) { s->class = c; } + if (state && streq(state, "closing")) + s->stopping = true; + if (s->fifo_path) { int fd; /* If we open an unopened pipe for reading we will not get an EOF. to trigger an EOF we hence open it for - reading, but close it right-away which then will - trigger the EOF. */ + writing, but close it right away which then will + trigger the EOF. This will happen immediately if no + other process has the FIFO open for writing, i. e. + when the session died before logind (re)started. */ fd = session_create_fifo(s); safe_close(fd);