From a09131a479da465b1a49adda984b8c1c46c3a173 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 27 Jul 2017 11:15:34 -0400 Subject: [PATCH] bug fix w/ O_NONBLOCK flag. --- src/finder_info.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/finder_info.cpp b/src/finder_info.cpp index a1b33f1..fbeb456 100644 --- a/src/finder_info.cpp +++ b/src/finder_info.cpp @@ -61,7 +61,6 @@ namespace { #if defined(_WIN32) - #ifdef MSVC #define AFP_ERROR_FILE_NOT_FOUND ERROR_FILE_NOT_FOUND #define remap_os_error(x) x @@ -168,7 +167,7 @@ extern "C" int remap_os_error(unsigned long); /* opens a file read-only and verifies it's a regular file */ int openX(const std::string &path, std::error_code &ec) { - int fd = _(::open(path.c_str(), O_RDONLY, O_NONBLOCK), ec); + int fd = _(::open(path.c_str(), O_RDONLY | O_NONBLOCK), ec); if (fd >= 0 && !regular_file(fd, ec)) { ::close(fd); fd = -1;