summaryrefslogtreecommitdiff
path: root/Kernel/Devices/SerialDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Devices/SerialDevice.cpp')
-rw-r--r--Kernel/Devices/SerialDevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Devices/SerialDevice.cpp b/Kernel/Devices/SerialDevice.cpp
index a54a8bed3e..9801c6b83d 100644
--- a/Kernel/Devices/SerialDevice.cpp
+++ b/Kernel/Devices/SerialDevice.cpp
@@ -59,7 +59,7 @@ KResultOr<size_t> SerialDevice::read(FileDescription&, size_t, UserOrKernelBuffe
return (ssize_t)data_size;
});
if (nwritten < 0)
- return KResult(nwritten);
+ return KResult((ErrnoCode)-nwritten);
return size;
}
@@ -83,7 +83,7 @@ KResultOr<size_t> SerialDevice::write(FileDescription&, size_t, const UserOrKern
return (ssize_t)data_size;
});
if (nread < 0)
- return KResult(nread);
+ return KResult((ErrnoCode)-nread);
return (size_t)nread;
}