Skip to content
Commit 1e9592a9 authored by David Majnemer's avatar David Majnemer
Browse files

[libc++] random_device fails if open returns zero

random_device::random_device(const string&) wrongly assumes that open
can only validly return a file descriptor greater than zero.

This results in random_device believing that it didn't successfully open
the device causing it to throw in it's constructor, this ends up leaking
a file descriptor.

The fix is simple, don't error on file descriptors which are zero.

llvm-svn: 210060
parent cf2048bb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment