main: S_ISFIFO() matches both pipes and FIFOs

This commit is contained in:
Daniel Eklöf 2024-01-04 16:35:05 +01:00
parent cb2561a72c
commit bbbf2b601e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 3 additions and 3 deletions

View file

@ -18,8 +18,8 @@
* battery: scale option, for batteries that report 'charge' at a
different scale than 'current'.
* network: new `quality` tag (Wi-Fi only).
* Read alternative config from pipes (e.g. `--config /dev/stdin`)
([#340][340]).
* Read alternative config from pipes and FIFOs (e.g. `--config
/dev/stdin`) ([#340][340]).
[340]: https://codeberg.org/dnkl/yambar/pulls/340

2
main.c
View file

@ -224,7 +224,7 @@ main(int argc, char *const *argv)
fprintf(stderr, "%s: invalid configuration file: %s\n", optarg, strerror(errno));
return EXIT_FAILURE;
} 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",
fprintf(stderr, "%s: invalid configuration file: neither a regular file nor a pipe or FIFO\n",
optarg);
return EXIT_FAILURE;
}