cgroup-util: remove now unused cg_read_event()

cg_get_keyed_attribute() is a more generic version of this,
and cg_is_empty_recursive() was the only user of this function,
which got converted in the previous commit.
This commit is contained in:
Mike Yuan
2025-05-26 22:59:48 +02:00
parent c3f900770d
commit b823f7bb6a
2 changed files with 0 additions and 42 deletions
-41
View File
@@ -198,47 +198,6 @@ int cg_read_pidref(FILE *f, PidRef *ret, CGroupFlags flags) {
}
}
int cg_read_event(
const char *controller,
const char *path,
const char *event,
char **ret) {
_cleanup_free_ char *events = NULL, *content = NULL;
int r;
r = cg_get_path(controller, path, "cgroup.events", &events);
if (r < 0)
return r;
r = read_full_virtual_file(events, &content, NULL);
if (r < 0)
return r;
for (const char *p = content;;) {
_cleanup_free_ char *line = NULL, *key = NULL;
const char *q;
r = extract_first_word(&p, &line, "\n", 0);
if (r < 0)
return r;
if (r == 0)
return -ENOENT;
q = line;
r = extract_first_word(&q, &key, " ", 0);
if (r < 0)
return r;
if (r == 0)
return -EINVAL;
if (!streq(key, event))
continue;
return strdup_to(ret, q);
}
}
bool cg_kill_supported(void) {
static thread_local int supported = -1;
-1
View File
@@ -188,7 +188,6 @@ typedef enum CGroupFlags {
int cg_enumerate_processes(const char *controller, const char *path, FILE **ret);
int cg_read_pid(FILE *f, pid_t *ret, CGroupFlags flags);
int cg_read_pidref(FILE *f, PidRef *ret, CGroupFlags flags);
int cg_read_event(const char *controller, const char *path, const char *event, char **ret);
int cg_enumerate_subgroups(const char *controller, const char *path, DIR **ret);
int cg_read_subgroup(DIR *d, char **ret);