summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-06 11:45:02 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-06 11:45:52 +0200
commit2f1d596dd379c9c3e66bb5fef00d875b126d86b7 (patch)
treeface3f4537ab920e9a4d6aa8010661234d982d02 /DevTools
parent0d6597df2b1f53f00f3ed6ccc55ffa7541aa6201 (diff)
downloadserenity-2f1d596dd379c9c3e66bb5fef00d875b126d86b7.zip
UserspaceEmulator: Fix bad rc check in ttyname and getcwd syscalls
Errors here are (rc < 0), not (rc < 1).
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/UserspaceEmulator/Emulator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp
index 6330c8b5a2..a506030d79 100644
--- a/DevTools/UserspaceEmulator/Emulator.cpp
+++ b/DevTools/UserspaceEmulator/Emulator.cpp
@@ -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;