More thorough use of O_BINARY.

This commit is contained in:
Markus F.X.J. Oberhumer
2016-10-07 15:04:12 +02:00
parent 42206364e5
commit ed900b0476
6 changed files with 14 additions and 9 deletions
+2 -2
View File
@@ -626,9 +626,9 @@ unsigned Packer::getRandomId() const
unsigned id = 0;
#if 0 && defined(__unix__)
// Don't consume precious bytes from /dev/urandom.
int fd = open("/dev/urandom", O_RDONLY);
int fd = open("/dev/urandom", O_RDONLY | O_BINARY);
if (fd < 0)
fd = open("/dev/random", O_RDONLY);
fd = open("/dev/random", O_RDONLY | O_BINARY);
if (fd >= 0)
{
if (read(fd, &id, 4) != 4)