diff options
author | Antique <phrdina@redhat.com> | 2018-04-26 12:37:35 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-06-28 09:24:07 +0200 |
commit | 91b7eae095db9442e5473c626175185cf448ba51 (patch) | |
tree | 9feea2db5fb2cfbbbc0e9a5684403476558557ef /src/basic/cgroup-util.c | |
parent | a7803239f6da32aadca17593178ee24f06be6168 (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>
(cherry picked from commit 96aa6591d1103b8cca9a4db80ba478a18bdf3e9a)
Diffstat (limited to 'src/basic/cgroup-util.c')
-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 bc012b6b2..fa9275043 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2727,8 +2727,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); + } } } |