LibCore: Fix logic deciding when to open files in non-blocking mode

The if statement for setting the O_NONBLOCK flag was written the other
way around, causing Core::File to open files in non-blocking mode, when
we didn't actually specify it.
This commit is contained in:
Karol Kosek 2023-05-13 18:13:31 +02:00 committed by Jelle Raaijmakers
parent ff970e9295
commit 1367809142
Notes: sideshowbarker 2024-07-17 07:16:27 +09:00

View file

@ -85,7 +85,7 @@ int File::open_mode_to_options(OpenMode mode)
flags |= O_EXCL;
if (!has_flag(mode, OpenMode::KeepOnExec))
flags |= O_CLOEXEC;
if (!has_flag(mode, OpenMode::Nonblocking))
if (has_flag(mode, OpenMode::Nonblocking))
flags |= O_NONBLOCK;
// Some open modes, like `ReadWrite` imply the ability to create the file if it doesn't exist.