]> git.ipfire.org Git - thirdparty/glibc.git/commit
libio: Synthesize ESPIPE error if lseek returns 0 after reading bytes
authorFlorian Weimer <fweimer@redhat.com>
Tue, 8 Apr 2025 16:38:38 +0000 (18:38 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 14 Apr 2025 07:59:12 +0000 (09:59 +0200)
commit7b47b3dd214c8ff2c699f13efe5533941be53635
tree595e4959df5fe39c6ab46681a40b6843c652ed63
parentde14f1959ee5f9b845a7cae43bee03068b8136f0
libio: Synthesize ESPIPE error if lseek returns 0 after reading bytes

This is required so that fclose, when trying to seek to the right
position after filling the input buffer, does not fail with EINVAL.
This fclose code path only ignores ESPIPE errors.

Reported by Petr Pisar on
<https://bugzilla.redhat.com/show_bug.cgi?id=2358265>.

Fixes commit be6818be31e756398e45f70e2819d78be0961223 ("Make fclose
seek input file to right offset (bug 12724)").

Reviewed-by: Frédéric Bérat <fberat@redhat.com>
libio/fileops.c
stdio-common/Makefile
stdio-common/tst-fclose-devzero.c [new file with mode: 0644]