File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -262,9 +262,10 @@ int open(const path& filename, bool MSC_OR_NOAPPLE(random)) NOEXCEPT
262262#else
263263 // open sets errno on failure.
264264 file_descriptor = ::open (path.c_str (), O_RDWR, S_IRUSR | S_IWUSR);
265+
266+ #if !defined(HAVE_APPLE)
265267 if (file_descriptor != -1 )
266268 {
267- #if !defined(HAVE_APPLE)
268269 // _O_RANDOM equivalent, posix_fadvise returns error on failure.
269270 const auto advice = random ? POSIX_FADV_RANDOM : POSIX_FADV_SEQUENTIAL;
270271 const auto result = ::posix_fadvise (file_descriptor, 0 , 0 , advice);
@@ -273,8 +274,8 @@ int open(const path& filename, bool MSC_OR_NOAPPLE(random)) NOEXCEPT
273274 close (file_descriptor);
274275 file_descriptor = -1 ;
275276 errno = result;
276- } else
277- # endif
277+ }
278+ else
278279 {
279280 // _SH_DENYWR equivalent.
280281 const struct flock lock{ F_WRLCK, SEEK_SET, 0 , 0 };
@@ -287,7 +288,8 @@ int open(const path& filename, bool MSC_OR_NOAPPLE(random)) NOEXCEPT
287288 }
288289 }
289290 }
290- #endif
291+ #endif // !HAVE_APPLE
292+ #endif // HAVE_MSC
291293
292294 return file_descriptor;
293295}
You can’t perform that action at this time.
0 commit comments