mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
fsync: Open files in non-blocking mode
This avoids blocking forever when invoked on a fifo. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54084
This commit is contained in:
parent
4c2295c158
commit
69e041521a
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ main(int argc, char *argv[])
|
|||
|
||||
rval = EX_OK;
|
||||
for (i = 1; i < argc; ++i) {
|
||||
if ((fd = open(argv[i], O_RDONLY)) == -1) {
|
||||
if ((fd = open(argv[i], O_RDONLY | O_NONBLOCK)) == -1) {
|
||||
warn("open %s", argv[i]);
|
||||
if (rval == EX_OK)
|
||||
rval = EX_NOINPUT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue