LibCore: Don't use has_flag() with multiple flags (OpenMode::ReadWrite)

Fixes boot, regressed in a91a49337c.
This commit is contained in:
Ali Mohammad Pur 2021-05-12 15:17:38 +04:30 committed by Andreas Kling
parent 1ae8775a1b
commit c7b60164ed
Notes: sideshowbarker 2024-07-18 18:18:26 +09:00

View file

@ -63,7 +63,7 @@ bool File::open_impl(OpenMode mode, mode_t permissions)
{
VERIFY(!m_filename.is_null());
int flags = 0;
if (has_flag(mode, OpenMode::ReadWrite)) {
if (has_flag(mode, OpenMode::ReadOnly) && has_flag(mode, OpenMode::WriteOnly)) {
flags |= O_RDWR | O_CREAT;
} else if (has_flag(mode, OpenMode::ReadOnly)) {
flags |= O_RDONLY;