--- procps-3.1.5/sysctl.c~ Thu Jan 16 11:43:14 2003 +++ procps-3.1.5/sysctl.c Thu Jan 16 11:43:14 2003 @@ -320,7 +320,13 @@ int n = 0; int rc = 0; char *name, *value; + int reading_stdin = 0; + if (filename && filename[0] == '-' && filename[1] == 0) { + fp = stdin; + reading_stdin = 1; + } + else if (!filename || ((fp = fopen(filename, "r")) == NULL)) { fprintf(stderr, ERR_PRELOAD_FILE, filename); return -1; @@ -358,7 +364,9 @@ rc |= WriteSetting(buffer); } - fclose(fp); + if (!reading_stdin) + fclose(fp); + return rc; } --- procps-3.1.5/sysctl.8~ Thu Jan 16 12:01:43 2003 +++ procps-3.1.5/sysctl.8 Thu Jan 16 12:01:43 2003 @@ -49,7 +49,8 @@ Use this option when you want to change a sysctl setting. .TP .B "-p" -Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. +Load in sysctl settings from the file specified or /etc/sysctl.conf if none +given. Specifying "-" as filename means reading data from standard input. .TP .B "-a" Display all values currently available.