summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-10 19:17:30 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-10 22:31:29 +0200
commit2146d22432ef200da3887d3777b6e085171f5389 (patch)
treedb98df4cc8a3529ba7d0ba759840a6b48e5937a1 /Userland/Libraries/LibCore
parent06353077b75f4210c8678e5dff3ffb7a61c5ff4e (diff)
downloadserenity-2146d22432ef200da3887d3777b6e085171f5389.zip
LibCore: Save errno before it gets clobbered in Core::IODevice::write()
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r--Userland/Libraries/LibCore/IODevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/IODevice.cpp b/Userland/Libraries/LibCore/IODevice.cpp
index 58f29ed057..e3df3a743e 100644
--- a/Userland/Libraries/LibCore/IODevice.cpp
+++ b/Userland/Libraries/LibCore/IODevice.cpp
@@ -281,8 +281,8 @@ bool IODevice::write(const u8* data, int size)
{
int rc = ::write(m_fd, data, size);
if (rc < 0) {
- perror("IODevice::write: write");
set_error(errno);
+ perror("IODevice::write: write");
return false;
}
return rc == size;