diff options
author | albert <> | 2006-06-24 21:17:51 +0000 |
---|---|---|
committer | albert <> | 2006-06-24 21:17:51 +0000 |
commit | a791f8034f1d70572c0f2cf13881078bebcb0643 (patch) | |
tree | 4f4bbb289ade2c5fbb3812d02f4df009087ad193 /sysctl.c | |
parent | 47d33e7ed4e4d4f8a6910f796b776f9617a2e93a (diff) | |
download | procps-ng-a791f8034f1d70572c0f2cf13881078bebcb0643.tar.gz |
sysctl: use - for stdin
Diffstat (limited to 'sysctl.c')
-rw-r--r-- | sysctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -365,7 +365,12 @@ static int Preload(const char *restrict const filename) { int rc = 0; char *name, *value; - if (!filename || ((fp = fopen(filename, "r")) == NULL)) { + fp = (filename[0]=='-' && !filename[1]) + ? stdin + : fopen(filename, "r") + ; + + if (!fp) { fprintf(stderr, ERR_PRELOAD_FILE, filename); return -1; } |