SEEK_DATA should fail at EOF (was: coreutils-9.6-1 (TEST): cp: infinite SEEK_SET/DATA/HOLE loop if file is compressed)
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Feb 14 14:45:16 GMT 2025
On Feb 14 14:14, Corinna Vinschen via Cygwin wrote:
> On Feb 14 13:49, Corinna Vinschen via Cygwin wrote:
> > On Feb 14 12:24, Christian Franke via Cygwin wrote:
> > > Hmm... does "beyond" mean '>=' or '>' ?
> >
> > ...do you think this fixes it?
> >
> > diff --git a/winsup/cygwin/fhandler/base.cc b/winsup/cygwin/fhandler/base.cc
> > index 8f3dbd4ed51a..79dfaaa5987a 100644
> > --- a/winsup/cygwin/fhandler/base.cc
> > +++ b/winsup/cygwin/fhandler/base.cc
> > @@ -1144,7 +1144,7 @@ fhandler_base::lseek (off_t offset, int whence)
> > return -1;
> > }
> > /* Per Linux man page, ENXIO if offset is beyond EOF */
> > - if (offset > fsi.EndOfFile.QuadPart)
> > + if (offset >= fsi.EndOfFile.QuadPart)
> > {
> > set_errno (ENXIO);
> > return -1;
>
> Yeah, it does. I'll push the patch.
Patch is in the latest cygwin-3.6.0-0.373.gfac7441835b0
test release.
We're probably releasing 3.6 in the next few weeks.
Thanks,
Corinna
More information about the Cygwin
mailing list