[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug in apt-pkg/contrib/fileutl.cc ?

  I was hunting for a bug that lead to the "read, still have xxx to read
but none left" message and finally found something strange in
fileutl.cc... Here is the problem in FileFd::Read (there is the same bug
in FileFd::Write): in the reading loop, when read() is interrupted by a
signal, it returns -1 and sets errno to EINTR; if such an event occures,
the code does a "continue" that jumps to the test code (Res > 0 && Size > 0).
As Res was -1, this test fails, and the reading loop stops instead of

  I finally found that the bug I was hunting wasn't this one (it was a
problem with a rsync mirror) but I think it has to be corrected
(changing "while (Res > 0 && Size > 0)"
       to "while (Res != 0 && Size > 0)" should fix it)

  If what I tell you is wrong, please ignore this message...

Bertrand Croq

Reply to: