- if (!s->timer_event_source)
- sd_event_add_time(s->manager->event,
- &s->timer_event_source,
- CLOCK_MONOTONIC,
- now(CLOCK_MONOTONIC) + RELEASE_USEC, 0,
- release_timeout_callback, s);
+ if (s->timer_event_source)
+ return 0;
+
+#if 0 /// UNNEEDED by elogind
+ return sd_event_add_time(s->manager->event,
+ &s->timer_event_source,
+ CLOCK_MONOTONIC,
+ now(CLOCK_MONOTONIC) + RELEASE_USEC, 0,
+ release_timeout_callback, s);
+#else
+ /* In systemd, session release is triggered by user jobs
+ dying. In elogind we don't have that so go ahead and stop
+ now. */
+ return session_stop(s, false);
+#endif // 0