summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-05-12 15:17:38 +0430
committerAndreas Kling <kling@serenityos.org>2021-05-12 12:49:31 +0200
commitc7b60164ed95877ebc18d5783729b360213b7b9d (patch)
tree052f7cecd3d412a16aa177a70ebc2440fe791641 /Userland/Libraries/LibCore
parent1ae8775a1bb0af02932c54d1ab71d3201825519c (diff)
downloadserenity-c7b60164ed95877ebc18d5783729b360213b7b9d.zip
LibCore: Don't use has_flag() with multiple flags (OpenMode::ReadWrite)
Fixes boot, regressed in a91a49337c5992d64b30f493eea1eb492792b667.
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r--Userland/Libraries/LibCore/File.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/File.cpp b/Userland/Libraries/LibCore/File.cpp
index 90d0d24133..39d8c93e66 100644
--- a/Userland/Libraries/LibCore/File.cpp
+++ b/Userland/Libraries/LibCore/File.cpp
@@ -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;