X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Fcgroup-util.c;h=323c637fe926badb6400e8d983f6bf88bff43cec;hb=acf253bd3b176f711cefb4b53fff29b89a18c7cd;hp=315c449656aa073ce6aadad84e0506b82e246a6f;hpb=a72a1440215d558186c85ee1b5866f6d3f6e6045;p=elogind.git diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 315c44965..323c637fe 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -1088,6 +1088,7 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) { return -ENODATA; } +#if 0 /// UNNEEDED by elogind int cg_install_release_agent(const char *controller, const char *agent) { _cleanup_free_ char *fs = NULL, *contents = NULL; const char *sc; @@ -1110,6 +1111,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { return r; sc = strstrip(contents); + if (isempty(sc)) { r = write_string_file(fs, agent, 0); if (r < 0) @@ -1172,6 +1174,7 @@ int cg_uninstall_release_agent(const char *controller) { return 0; } +#endif // 0 int cg_is_empty(const char *controller, const char *path) { _cleanup_fclose_ FILE *f = NULL; @@ -1360,7 +1363,6 @@ int cg_mangle_path(const char *path, char **result) { } int cg_get_root_path(char **path) { -#if 0 /// elogind does not support systemd scopes and slices char *p, *e; int r; @@ -1370,20 +1372,20 @@ int cg_get_root_path(char **path) { if (r < 0) return r; +#if 0 /// elogind does not support systemd scopes and slices e = endswith(p, "/" SPECIAL_INIT_SCOPE); if (!e) e = endswith(p, "/" SPECIAL_SYSTEM_SLICE); /* legacy */ if (!e) e = endswith(p, "/system"); /* even more legacy */ +#else + e = endswith(p, "/elogind"); +#endif // 0 if (e) *e = 0; *path = p; return 0; -#else - assert(path); - return cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, 1, path); -#endif // 0 } int cg_shift_path(const char *cgroup, const char *root, const char **shifted) {