X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-session.c;h=109e3ef133b8c9274461503fe187e5afcfc7dae6;hb=6f5035f2db6ab7b4beae46c44b95e6a8b6d956b5;hp=08ca8072aeb5e9125177671b1489d0ff5de58cf3;hpb=08e1896fb7a00a758c3a71a99e54f0ff69da2fbd;p=elogind.git diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 08ca8072a..109e3ef13 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -38,8 +38,6 @@ #include "bus-error.h" #include "logind-session.h" -#define RELEASE_USEC (20*USEC_PER_SEC) - static void session_remove_fifo(Session *s); Session* session_new(Manager *m, const char *id) { @@ -599,16 +597,6 @@ int session_finalize(Session *s) { return r; } -static int release_timeout_callback(sd_event_source *es, uint64_t usec, void *userdata) { - Session *s = userdata; - - assert(es); - assert(s); - - session_stop(s, false); - return 0; -} - int session_release(Session *s) { assert(s); @@ -618,11 +606,10 @@ int session_release(Session *s) { if (s->timer_event_source) return 0; - return sd_event_add_time(s->manager->event, - &s->timer_event_source, - CLOCK_MONOTONIC, - now(CLOCK_MONOTONIC) + RELEASE_USEC, 0, - release_timeout_callback, s); + /* In systemd, session release is triggered by user jobs + dying. In elogind we don't have that so go ahead and stop + now. */ + session_stop(s, false); } bool session_is_active(Session *s) {