diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-06-27 22:44:12 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-27 22:44:12 +0200 |
commit | 4d6d6518c301c844be59c1b3a0d2092a3218572f (patch) | |
tree | cd41151f7bcecd6eaf1694c2146cb9cef2701952 /src/logind-session.c | |
parent | cd58752a158ccab3db77d355410b31b457df4cfc (diff) |
logind: automatically deduce seat from display
Diffstat (limited to 'src/logind-session.c')
-rw-r--r-- | src/logind-session.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/logind-session.c b/src/logind-session.c index e71ff4f14e..9fcbf460a3 100644 --- a/src/logind-session.c +++ b/src/logind-session.c @@ -325,14 +325,6 @@ int session_activate(Session *s) { return seat_apply_acls(s->seat, old_active); } -bool x11_display_is_local(const char *display) { - assert(display); - - return - display[0] == ':' && - display[1] >= '0' && - display[1] <= '9'; -} static int session_link_x11_socket(Session *s) { char *t, *f, *c; @@ -345,7 +337,7 @@ static int session_link_x11_socket(Session *s) { if (s->user->display) return 0; - if (!s->display || !x11_display_is_local(s->display)) + if (!s->display || !display_is_local(s->display)) return 0; k = strspn(s->display+1, "0123456789"); @@ -447,9 +439,9 @@ static int session_create_cgroup(Session *s) { r = session_create_one_group(s, SYSTEMD_CGROUP_CONTROLLER, p); if (r < 0) { + log_error("Failed to create "SYSTEMD_CGROUP_CONTROLLER":%s: %s", p, strerror(-r)); free(p); s->cgroup_path = NULL; - log_error("Failed to create "SYSTEMD_CGROUP_CONTROLLER":%s: %s", p, strerror(-r)); return r; } |