diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f2c57..72f7eb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ ### Changed * log-level: default to `warning` +* Read alternative config from pipes (e.g. `--config /dev/stdin`) + ([#340][340]). ### Deprecated ### Removed diff --git a/main.c b/main.c index 9604631..3a8b9f7 100644 --- a/main.c +++ b/main.c @@ -223,8 +223,8 @@ main(int argc, char *const *argv) if (stat(optarg, &st) == -1) { fprintf(stderr, "%s: invalid configuration file: %s\n", optarg, strerror(errno)); return EXIT_FAILURE; - } else if (!S_ISREG(st.st_mode)) { - fprintf(stderr, "%s: invalid configuration file: not a regular file\n", + } else if (!S_ISREG(st.st_mode) && !S_ISFIFO(st.st_mode)) { + fprintf(stderr, "%s: invalid configuration file: neither a regular file nor a pipe\n", optarg); return EXIT_FAILURE; }