Blame 0068-cgroup-util-replace-one-use-of-fgets-by-read_line.patch
|
|
44a72b9 |
From f4037dc520045b4779cf8589bd75ced2d343c215 Mon Sep 17 00:00:00 2001
|
|
|
44a72b9 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
44a72b9 |
Date: Fri, 22 Sep 2017 18:25:45 +0200
|
|
|
44a72b9 |
Subject: [PATCH] cgroup-util: replace one use of fgets() by read_line()
|
|
|
44a72b9 |
|
|
|
44a72b9 |
(cherry picked from commit 2351e44d3ed57b7a48b9e544a59c3b797ac4d216)
|
|
|
44a72b9 |
---
|
|
|
44a72b9 |
src/basic/cgroup-util.c | 3 +--
|
|
|
44a72b9 |
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
44a72b9 |
|
|
|
44a72b9 |
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
|
|
|
44a72b9 |
index 6344372610..9148a7b1ab 100644
|
|
|
44a72b9 |
--- a/src/basic/cgroup-util.c
|
|
|
44a72b9 |
+++ b/src/basic/cgroup-util.c
|
|
|
44a72b9 |
@@ -2326,7 +2326,6 @@ int cg_mask_supported(CGroupMask *ret) {
|
|
|
44a72b9 |
|
|
|
44a72b9 |
int cg_kernel_controllers(Set *controllers) {
|
|
|
44a72b9 |
_cleanup_fclose_ FILE *f = NULL;
|
|
|
44a72b9 |
- char buf[LINE_MAX];
|
|
|
44a72b9 |
int r;
|
|
|
44a72b9 |
|
|
|
44a72b9 |
assert(controllers);
|
|
|
44a72b9 |
@@ -2344,7 +2343,7 @@ int cg_kernel_controllers(Set *controllers) {
|
|
|
44a72b9 |
}
|
|
|
44a72b9 |
|
|
|
44a72b9 |
/* Ignore the header line */
|
|
|
44a72b9 |
- (void) fgets(buf, sizeof(buf), f);
|
|
|
44a72b9 |
+ (void) read_line(f, (size_t) -1, NULL);
|
|
|
44a72b9 |
|
|
|
44a72b9 |
for (;;) {
|
|
|
44a72b9 |
char *controller;
|