Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix readFile API doing blocking I/O with a non-blocking handle (#6368)
When a block size is passed to the readFile function or a file has no size, the read is forced to be blocking, even if the handle is opened as non-blocking. The opposite can happen too, a blocking handle is opened but since a block size of 0 is passed, and the file size is not 0, the file is read with non-blocking I/O. This change bases the decision of doing blocking or non-blocking I/O mainly on the "blocking" parameter of the readFile function and the file being a special file or not. If a handle is opened in non-blocking mode but the file is special, the handle is reopened as blocking. Also give a different name to the overload that provides a way to do a read file check via readFile.
- Loading branch information
Showing
2 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters