mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05: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
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…
Add table
Reference in a new issue