mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01: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:
1 parent
4c2295c158
commit
69e041521a
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user