On 04/22/2015 03:24 PM, cyg Simple wrote: >> From: Eric Blake >> >> It looks like something is going wrong with lseek() mixed with text-mode >> mounts. >> > > I thought lseek was reserved for binary only channels due to the loss of > character count because of the CRLF to LF translation.
[you may want to teach your mailer to wrap long lines] lseek works on files opened in text mode - BUT it only works to the underlying offset in the file. You are correct that if you read() 500 bytes, and then try to seek relative to current offset backwards by 100 bytes, that you have to be careful of whether you meant 100 bytes of text read (but possibly more than 100 bytes when you include \r), or 100 bytes of offset (but possibly less than 100 bytes read because \r was stripped). What I haven't yet determined is if the bug lies in bash, for using lseek() with the wrong numbers on a text mode file, or in cygwin itself, for not properly handling file repositioning of stdin after flush() prior to fork(), when stdin is in text mode. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature