diff options
author | Antique <phrdina@redhat.com> | 2018-04-26 12:37:35 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 177629c34ed8345b561c7f04a3698981d4df5f0a (patch) | |
tree | a7caf9bb0c9f4ffe3b36fb267038592adf012e27 /src | |
parent | 2934ecd6193be55dc11527b6cca0579699f95c95 (diff) |
cgroup-util: fix enabling of controllers (#8816)
If enabling controller for some reason fails we need to clear error
for the FILE stream. Enabling remaining controllers would otherwise
fail because write_string_stream_ts() checks for ferror(f) and returns
-EIO if there is one.
Broken by commit <77fa610b22>.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/cgroup-util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 1c5ca9899..0570e9abf 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2718,8 +2718,10 @@ int cg_enable_everywhere(CGroupMask supported, CGroupMask mask, const char *p) { } r = write_string_stream(f, s, 0); - if (r < 0) + if (r < 0) { log_debug_errno(r, "Failed to enable controller %s for %s (%s): %m", n, p, fs); + clearerr(f); + } } } |