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)
}
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);
+ }
}
}