chiark / gitweb /
test-functions:install_libnss() call dracut_install with all $NSS_LIBS
[elogind.git] / src / shared / cgroup-util.c
index 86729f14bf925be2dde0bf36205517e29f4ee148..b527868e6bd1e3802ee680a66b9753826d1be54e 100644 (file)
@@ -510,7 +510,7 @@ static int check_hierarchy(const char *p) {
                 return 0;
 
         /* Check if this controller actually really exists */
-        cc = strappenda("/sys/fs/cgroup/", p);
+        cc = strjoina("/sys/fs/cgroup/", p);
         if (laccess(cc, F_OK) < 0)
                 return -errno;
 
@@ -1592,6 +1592,17 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri
         return write_string_file_no_create(p, value);
 }
 
+int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
+        _cleanup_free_ char *p = NULL;
+        int r;
+
+        r = cg_get_path(controller, path, attribute, &p);
+        if (r < 0)
+                return r;
+
+        return read_one_line_file(p, ret);
+}
+
 static const char mask_names[] =
         "cpu\0"
         "cpuacct\0"