1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

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

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;