mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 07:54:58 +00:00
MappedFile: Fix misuse of StringView::characters().
This makes me wonder if the open() syscall should take characters+length and we'd compute the length at the LibC layer instead. That way we could also provide an optional non-POSIX open() that takes the length directly..
This commit is contained in:
parent
a8aadf73e9
commit
c79b048198
1 changed files with 2 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <AK/AKString.h>
|
||||
#include <AK/MappedFile.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
@ -12,7 +13,7 @@ namespace AK {
|
|||
MappedFile::MappedFile(const StringView& file_name)
|
||||
{
|
||||
m_size = PAGE_SIZE;
|
||||
m_fd = open(file_name.characters(), O_RDONLY | O_CLOEXEC);
|
||||
m_fd = open(String(file_name).characters(), O_RDONLY | O_CLOEXEC);
|
||||
|
||||
if (m_fd != -1) {
|
||||
struct stat st;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue