From: Sami Farin Date: Fri, 14 Mar 2014 06:00:00 +0000 (-0600) Subject: sysctl: increase max supported line length of the conf file X-Git-Tag: v3.3.10~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c7e8b82f872e2d46ce866255ff132e0e6a0f937;p=procps-ng sysctl: increase max supported line length of the conf file I ran into this limit with net.ipv4.ip_local_reserved_ports , sysctl complained about the line after the long line, further slowing down my error hunting. Due to fgets usage, increase buffer size to 4096 chars with minimum amount of code changes. Signed-off-by: Sami Farin --- diff --git a/sysctl.c b/sysctl.c index 51af15dc..fc224e5d 100644 --- a/sysctl.c +++ b/sysctl.c @@ -483,14 +483,16 @@ static int pattern_match(const char *string, const char *pat) return (1); } +#define LINELEN 4096 + /* * Preload the sysctl's from the conf file. We parse the file and then * reform it (strip out whitespace). */ static int Preload(const char *restrict const filename) { - char oneline[256]; - char buffer[256]; + char oneline[LINELEN]; + char buffer[LINELEN]; FILE *fp; char *t; int n = 0;