cgroup-util: replace one use of fgets() by read_line()
This commit is contained in:
parent
f4b51a2d09
commit
2351e44d3e
|
@ -2326,7 +2326,6 @@ int cg_mask_supported(CGroupMask *ret) {
|
||||||
|
|
||||||
int cg_kernel_controllers(Set *controllers) {
|
int cg_kernel_controllers(Set *controllers) {
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
char buf[LINE_MAX];
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(controllers);
|
assert(controllers);
|
||||||
|
@ -2344,7 +2343,7 @@ int cg_kernel_controllers(Set *controllers) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore the header line */
|
/* Ignore the header line */
|
||||||
(void) fgets(buf, sizeof(buf), f);
|
(void) read_line(f, (size_t) -1, NULL);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
char *controller;
|
char *controller;
|
||||||
|
|
Loading…
Reference in New Issue