This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] libstdc++/65142 Check read() result in std::random_device.
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 17 Sep 2015 22:28:11 +0100
- Subject: Re: [patch] libstdc++/65142 Check read() result in std::random_device.
- Authentication-results: sourceware.org; auth=none
- References: <20150911134418 dot GK2631 at redhat dot com> <20150915114713 dot GS2631 at redhat dot com> <20150917150757 dot GF2969 at redhat dot com> <alpine dot LSU dot 2 dot 20 dot 1509172025460 dot 3004 at tuna dot site>
On 17/09/15 22:21 +0200, Gerald Pfeifer wrote:
On Thu, 17 Sep 2015, Jonathan Wakely wrote:
Any comments on this version?
Committed to trunk.
Unfortunately this broke bootstrap on FreeBSD 10.1.
/scratch/tmp/gerald/gcc-HEAD/libstdc++-v3/src/c++11/random.cc: In member function 'std::random_device::result_type std::random_device::_M_getval()':
/scratch/tmp/gerald/gcc-HEAD/libstdc++-v3/src/c++11/random.cc:144:22: error: 'errno' was not declared in this scope
else if (e != -1 || errno != EINTR)
^
/scratch/tmp/gerald/gcc-HEAD/libstdc++-v3/src/c++11/random.cc:144:31: error: 'EINTR' was not declared in this scope
else if (e != -1 || errno != EINTR)
^
Makefile:545: recipe for target 'random.lo' failed
I probably won't be able to dig in deeper today, but figured this
might already send you on the right path?
Actually...
...how about he patch below? Bootstraps on i386-unknown-freebsd10.1,
no regressions.
Sorry about that, I've committed your patch.
Gerald
2015-09-17 Gerald Pfeifer <gerald@pfeifer.com>
* src/c++11/random.cc: Include <cerrno>.
Index: libstdc++-v3/src/c++11/random.cc
===================================================================
--- libstdc++-v3/src/c++11/random.cc (revision 227883)
+++ libstdc++-v3/src/c++11/random.cc (working copy)
@@ -31,6 +31,7 @@
# include <cpuid.h>
#endif
+#include <cerrno>
#include <cstdio>
#ifdef _GLIBCXX_HAVE_UNISTD_H