Skip to content

Commit ebcbeea

Browse files
committed
remove errno handling
1 parent c6f84ea commit ebcbeea

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

runtime-light/stdlib/math/random-functions.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
#include <cstdint>
1212
#include <format>
1313
#include <limits>
14-
#include <locale.h>
1514
#include <memory>
1615
#include <random>
17-
#include <string.h>
1816
#include <utility>
1917

2018
#if defined(__APPLE__)
@@ -152,9 +150,7 @@ inline Optional<string> f$random_bytes(int64_t length) noexcept {
152150
string str{static_cast<string::size_type>(length), false};
153151

154152
if (random_impl_::secure_rand_buf(str.buffer(), static_cast<size_t>(length)) == -1) {
155-
locale_t c_locale{(kphp::memory::libc_alloc_guard{}, newlocale(LC_MESSAGES_MASK, "C", nullptr))};
156-
kphp::log::warning("source of randomness cannot be found: {}", strerror_l(errno, c_locale));
157-
kphp::memory::libc_alloc_guard{}, freelocale(c_locale);
153+
kphp::log::warning("source of randomness cannot be found");
158154
return false;
159155
}
160156

0 commit comments

Comments
 (0)