sysctl: use - for stdin

This commit is contained in:
albert
2006-06-24 21:17:51 +00:00
parent 47d33e7ed4
commit a791f8034f
3 changed files with 9 additions and 2 deletions

View File

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