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 <hvtaifwkbgefbaei@gmail.com>
This commit is contained in:
Sami Farin 2014-03-14 00:00:00 -06:00 committed by Jaromir Capik
parent 2ec9f5c22e
commit 9c7e8b82f8

View File

@ -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;