X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Fcgroup-util.c;h=b3e92763cde20ca9526f83b2dfce79319f51f1d0;hb=372e2cc96c65d0a92eb969be911ace6d2dc8fc46;hp=479254159e54c6b05f2e021fbe89adfacac47592;hpb=5db0e7adf018c82dd63cd21d31dd313dff5561af;p=elogind.git diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 479254159..b3e92763c 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -837,14 +837,12 @@ int cg_install_release_agent(const char *controller, const char *agent) { } else if (!streq(sc, agent)) return -EEXIST; - free(fs); - fs = NULL; + fs = mfree(fs); r = cg_get_path(controller, NULL, "notify_on_release", &fs); if (r < 0) return r; - free(contents); - contents = NULL; + contents = mfree(contents); r = read_one_line_file(fs, &contents); if (r < 0) return r; @@ -876,8 +874,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; - free(fs); - fs = NULL; + fs = mfree(fs); r = cg_get_path(controller, NULL, "release_agent", &fs); if (r < 0) @@ -1360,8 +1357,6 @@ int cg_path_get_user_unit(const char *path, char **ret) { return cg_path_get_unit(t, ret); } -/// UNNEDED by elogind -#if 0 int cg_pid_get_user_unit(pid_t pid, char **unit) { _cleanup_free_ char *cgroup = NULL; int r; @@ -1374,7 +1369,6 @@ int cg_pid_get_user_unit(pid_t pid, char **unit) { return cg_path_get_user_unit(cgroup, unit); } -#endif // 0 int cg_path_get_machine_name(const char *path, char **machine) { _cleanup_free_ char *u = NULL, *sl = NULL; @@ -1391,8 +1385,6 @@ int cg_path_get_machine_name(const char *path, char **machine) { return readlink_malloc(sl, machine); } -/// UNNEDED by elogind -#if 0 int cg_pid_get_machine_name(pid_t pid, char **machine) { _cleanup_free_ char *cgroup = NULL; int r; @@ -1405,7 +1397,6 @@ int cg_pid_get_machine_name(pid_t pid, char **machine) { return cg_path_get_machine_name(cgroup, machine); } -#endif // 0 int cg_path_get_session(const char *path, char **session) { _cleanup_free_ char *unit = NULL; @@ -1478,8 +1469,6 @@ int cg_path_get_owner_uid(const char *path, uid_t *uid) { return 0; } -/// UNNEDED by elogind -#if 0 int cg_pid_get_owner_uid(pid_t pid, uid_t *uid) { _cleanup_free_ char *cgroup = NULL; int r; @@ -1490,7 +1479,6 @@ int cg_pid_get_owner_uid(pid_t pid, uid_t *uid) { return cg_path_get_owner_uid(cgroup, uid); } -#endif // 0 int cg_path_get_slice(const char *p, char **slice) { const char *e = NULL;