[iostreams] file_descriptor::read bug?

In the source libs/iostreams/src/file_descriptor.cpp, file_descriptor::read, line 147, I think return static_cast<std::streamsize>(result); should be return static_cast<std::streamsize>(result == 0? -1: result); The Windows API ReadFile returns TRUE with result == 0 when it has come to end-of-file. Regards, Xi

Besides, is the iostreams Jam (v2) file missing something? The file file_descriptor.cpp seems not to be in the resulting libraries on Linux and Mac OS X, while it's fine on Windows. Xi On 4/18/07, Xi Wang <xi.wang@gmail.com> wrote:
In the source libs/iostreams/src/file_descriptor.cpp, file_descriptor::read, line 147, I think
return static_cast<std::streamsize>(result);
should be
return static_cast<std::streamsize>(result == 0? -1: result);
The Windows API ReadFile returns TRUE with result == 0 when it has come to end-of-file.
Regards,
Xi
participants (1)
-
Xi Wang