daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
923a60
From cde797e980fac7f8b1aa35db3f65fc591b820d62 Mon Sep 17 00:00:00 2001
923a60
From: Jan Synacek <jsynacek@redhat.com>
923a60
Date: Thu, 23 Nov 2017 09:27:06 +0100
923a60
Subject: [PATCH] cgroup-util: replace one use of fgets() by read_line()
923a60
923a60
(cherry picked from commit 2351e44d3ed57b7a48b9e544a59c3b797ac4d216)
923a60
923a60
Resolves: #1503106
923a60
---
923a60
 src/shared/cgroup-util.c | 3 +--
923a60
 1 file changed, 1 insertion(+), 2 deletions(-)
923a60
923a60
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
923a60
index f67b53b4de..4585450b39 100644
923a60
--- a/src/shared/cgroup-util.c
923a60
+++ b/src/shared/cgroup-util.c
923a60
@@ -1747,7 +1747,6 @@ CGroupControllerMask cg_mask_supported(void) {
923a60
 
923a60
 int cg_kernel_controllers(Set *controllers) {
923a60
         _cleanup_fclose_ FILE *f = NULL;
923a60
-        char buf[LINE_MAX];
923a60
         int r;
923a60
 
923a60
         assert(controllers);
923a60
@@ -1760,7 +1759,7 @@ int cg_kernel_controllers(Set *controllers) {
923a60
         }
923a60
 
923a60
         /* Ignore the header line */
923a60
-        (void) fgets(buf, sizeof(buf), f);
923a60
+        (void) read_line(f, (size_t) -1, NULL);
923a60
 
923a60
         for (;;) {
923a60
                 char *controller;