Boost logo

Boost Users :

From: Jonathan Turkanis (turkanis_at_[hidden])
Date: 2008-02-06 01:45:05


Marc Viala Perso wrote:
> Hi Jonathan,
>
> Thanks for handling this problem.
>
> Just to push more information on that subject, I've just tried, this
> morning, to replace file_descriptor_source/ file_descriptor_sink by
> fs::ifstream/fs::ofstream instance in the filtering chain and the same code
> snippet seems to works, i.e.:

This is fixed now in branches/iostreams_dev, to be merged into trunk
shortly.

The following patch should fix 1.34.1:

--
Index: file_descriptor.cpp
===================================================================
--- file_descriptor.cpp	(revision 43122)
+++ file_descriptor.cpp	(working copy)
@@ -144,7 +144,7 @@
          DWORD result;
          if (!::ReadFile(pimpl_->handle_, s, n, &result, NULL))
              throw detail::bad_read();
-        return static_cast<std::streamsize>(result);
+        return result == 0 ? -1 : static_cast<std::streamsize>(result);
      }
  #endif
      errno = 0;
-- 
Jonathan Turkanis
CodeRage
http://www.coderage.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net