mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
LibC: Make rewind() ignore errors as it should
POSIX says that rewind() should ignore errors and reset the stream's error indicator. So let's do that.
This commit is contained in:
parent
62ee003ef5
commit
36ee8a8c25
1 changed files with 2 additions and 4 deletions
|
@ -873,10 +873,8 @@ int fsetpos(FILE* stream, const fpos_t* pos)
|
|||
|
||||
void rewind(FILE* stream)
|
||||
{
|
||||
VERIFY(stream);
|
||||
ScopedFileLock lock(stream);
|
||||
int rc = stream->seek(0, SEEK_SET);
|
||||
VERIFY(rc == 0);
|
||||
fseek(stream, 0, SEEK_SET);
|
||||
clearerr(stream);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void stdout_putch(char*&, char ch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue