mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 09:27:35 +00:00
LibCore: CIODevice::set_error() is meant to be called with the 'errno'
The point of this function is to stash away the innermost error code so that we don't lose it by the time we get back to the client code.
This commit is contained in:
parent
910fab564e
commit
7127c4fdbb
4 changed files with 5 additions and 5 deletions
|
@ -126,7 +126,7 @@ ByteBuffer CIODevice::read_all()
|
|||
char read_buffer[4096];
|
||||
int nread = ::read(m_fd, read_buffer, sizeof(read_buffer));
|
||||
if (nread < 0) {
|
||||
set_error(nread);
|
||||
set_error(errno);
|
||||
return ByteBuffer::copy(data.data(), data.size());
|
||||
}
|
||||
if (nread == 0) {
|
||||
|
@ -196,7 +196,7 @@ bool CIODevice::close()
|
|||
return false;
|
||||
int rc = ::close(fd());
|
||||
if (rc < 0) {
|
||||
set_error(rc);
|
||||
set_error(errno);
|
||||
return false;
|
||||
}
|
||||
set_fd(-1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue