chiark / gitweb /
cgtop: work even if not all cgroups are available
[elogind.git] / src / login / logind-session.c
index e297d3feeba689880c2b01e51ffd8c0e31df79b2..1f3a7f375514802e09e71e61c490631823540830 100644 (file)
@@ -28,6 +28,7 @@
 #include "strv.h"
 #include "util.h"
 #include "mkdir.h"
+#include "path-util.h"
 #include "cgroup-util.h"
 #include "logind-session.h"
 
@@ -49,7 +50,7 @@ Session* session_new(Manager *m, User *u, const char *id) {
                 return NULL;
         }
 
-        s->id = file_name_from_path(s->state_file);
+        s->id = path_get_file_name(s->state_file);
 
         if (hashmap_put(m->sessions, s->id, s) < 0) {
                 free(s->state_file);
@@ -381,7 +382,7 @@ static int session_link_x11_socket(Session *s) {
         c[k] = 0;
 
         if (access(f, F_OK) < 0) {
-                log_warning("Session %s has display %s with nonexisting socket %s.", s->id, s->display, f);
+                log_warning("Session %s has display %s with non-existing socket %s.", s->id, s->display, f);
                 free(f);
                 return -ENOENT;
         }