diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-10-24 17:28:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-10-26 18:43:34 +0200 |
commit | 604028de6021e3bba62b1065e3655b071e342bf5 (patch) | |
tree | 079609dccbeb9165c6ac28f5f6a36ef640db9c6f /src/basic/cgroup-util.c | |
parent | cgroup-util: don't expect cg_mask_from_string()'s return value to be initialized (diff) | |
download | systemd-604028de6021e3bba62b1065e3655b071e342bf5.tar.xz systemd-604028de6021e3bba62b1065e3655b071e342bf5.zip |
cgroup-util: disable buffering for cg_enable_everywhere() when writing to cgroup attributes
Let's better be safe than sorry.
Diffstat (limited to '')
-rw-r--r-- | src/basic/cgroup-util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index d2e8ef0c07..a501049619 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -819,7 +819,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) { xsprintf(c, PID_FMT "\n", pid); - r = write_string_file(fs, c, 0); + r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) return r; @@ -1101,7 +1101,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { sc = strstrip(contents); if (isempty(sc)) { - r = write_string_file(fs, agent, 0); + r = write_string_file(fs, agent, WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) return r; } else if (!path_equal(sc, agent)) @@ -1119,7 +1119,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { sc = strstrip(contents); if (streq(sc, "0")) { - r = write_string_file(fs, "1", 0); + r = write_string_file(fs, "1", WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) return r; @@ -1146,7 +1146,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; - r = write_string_file(fs, "0", 0); + r = write_string_file(fs, "0", WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) return r; @@ -1156,7 +1156,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; - r = write_string_file(fs, "", 0); + r = write_string_file(fs, "", WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) return r; @@ -2015,7 +2015,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri if (r < 0) return r; - return write_string_file(p, value, 0); + return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER); } int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) { @@ -2604,7 +2604,7 @@ int cg_enable_everywhere(CGroupMask supported, CGroupMask mask, const char *p) { } } - r = write_string_stream(f, s, 0); + r = write_string_stream(f, s, WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) { log_debug_errno(r, "Failed to enable controller %s for %s (%s): %m", n, p, fs); clearerr(f); |