summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-31 10:03:46 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-31 11:06:00 +0100
commitd71bfb961426279dbb4f943b33f4dab5f054be6d (patch)
tree49d014eda871285fec038a6fb708ad30fbe5505e /Userland
parentbe5311be99bc96cd23273ce4517b806783ee4492 (diff)
downloadserenity-d71bfb961426279dbb4f943b33f4dab5f054be6d.zip
LibC: Fix bad error check after open() in dlopen()
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibC/dlfcn.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/dlfcn.cpp b/Userland/Libraries/LibC/dlfcn.cpp
index 5bbbaaacda..bcf6de70ae 100644
--- a/Userland/Libraries/LibC/dlfcn.cpp
+++ b/Userland/Libraries/LibC/dlfcn.cpp
@@ -78,7 +78,7 @@ void* dlopen(const char* filename, int flags)
}
int fd = open(filename, O_RDONLY);
- if (!fd) {
+ if (fd < 0) {
g_dlerror_msg = String::formatted("Unable to open file {}", filename);
return nullptr;
}