X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-session.c;h=3a77b833f53b5d1e8ea5fa9e8a308acbc202e162;hp=9025788909d078a4d81d4b7f6c862f35c32480df;hb=8331cb6e143dc261fd22af9a2a679196822326a9;hpb=2e95ec430d1d295404c517aee832ab5097f36e1c diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 902578890..3a77b833f 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -46,7 +46,7 @@ #include "user-util.h" #include "util.h" -// #define RELEASE_USEC (20*USEC_PER_SEC) +#define RELEASE_USEC (20*USEC_PER_SEC) static void session_remove_fifo(Session *s); @@ -550,8 +550,7 @@ static int session_start_scope(Session *s) { return 0; } -#endif // 0 - +#else static int session_start_cgroup(Session *s) { int r; @@ -570,7 +569,7 @@ static int session_start_cgroup(Session *s) { return 0; } - +#endif // 0 int session_start(Session *s) { int r; @@ -588,9 +587,7 @@ int session_start(Session *s) { return r; /* Create cgroup */ -/// elogind does its own session management without systemd units, -/// slices and scopes -#if 0 +#if 0 /// elogind does its own session management r = session_start_scope(s); #else r = session_start_cgroup(s); @@ -665,8 +662,7 @@ static int session_stop_scope(Session *s, bool force) { return 0; } -#endif // 0 - +#else static int session_stop_cgroup(Session *s, bool force) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; int r; @@ -681,6 +677,7 @@ static int session_stop_cgroup(Session *s, bool force) { return 0; } +#endif // 0 int session_stop(Session *s, bool force) { int r; @@ -785,17 +782,16 @@ int session_release(Session *s) { if (s->timer_event_source) return 0; - /* In systemd, session release is triggered by user jobs - dying. In elogind we don't have that so go ahead and stop - now. */ -#if 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 } @@ -1028,10 +1024,6 @@ bool session_check_gc(Session *s, bool drop_not_started) { return true; #endif // 0 - if ( s->user->manager - && (cg_is_empty_recursive (SYSTEMD_CGROUP_CONTROLLER, s->user->manager->cgroup_root) > 0) ) - return true; - return false; }