mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03: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
Notes:
sideshowbarker
2024-07-18 18:53:26 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/36ee8a8c259 Pull-request: https://github.com/SerenityOS/serenity/pull/6744
@ -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…
Reference in New Issue
Block a user