mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 13:00:29 +00:00
UserspaceEmulator: Fix bad rc check in ttyname and getcwd syscalls
Errors here are (rc < 0), not (rc < 1).
This commit is contained in:
parent
0d6597df2b
commit
2f1d596dd3
Notes:
sideshowbarker
2024-07-19 04:13:50 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2f1d596dd37
1 changed files with 2 additions and 2 deletions
|
@ -1271,7 +1271,7 @@ int Emulator::virt$ttyname(int fd, FlatPtr buffer, size_t buffer_size)
|
|||
{
|
||||
auto host_buffer = ByteBuffer::create_zeroed(buffer_size);
|
||||
int rc = syscall(SC_ttyname, fd, host_buffer.data(), host_buffer.size());
|
||||
if (rc < 1)
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
mmu().copy_to_vm(buffer, host_buffer.data(), host_buffer.size());
|
||||
return rc;
|
||||
|
@ -1281,7 +1281,7 @@ int Emulator::virt$getcwd(FlatPtr buffer, size_t buffer_size)
|
|||
{
|
||||
auto host_buffer = ByteBuffer::create_zeroed(buffer_size);
|
||||
int rc = syscall(SC_getcwd, host_buffer.data(), host_buffer.size());
|
||||
if (rc < 1)
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
mmu().copy_to_vm(buffer, host_buffer.data(), host_buffer.size());
|
||||
return rc;
|
||||
|
|
Loading…
Reference in a new issue