Skip to content

Commit b76bf84

Browse files
committed
[erts] Fix alternate erl_errno_id() implementation
1 parent 0a1ed7c commit b76bf84

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

erts/emulator/beam/erl_errno_str.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ erts_errno_init(void)
337337
size_t tot_sz = 0, arr_sz;
338338
char *ptr, *end_ptr;
339339

340+
if (init_done) {
341+
return;
342+
}
343+
340344
for (eno = 0; eno < ERTS_MAX_CACHED_ERRNO; eno++) {
341345
const char *str = errno_name(eno);
342346
if (str) {
@@ -431,6 +435,7 @@ erl_errno_id(int eno)
431435
* during initialization of the emulator.
432436
*/
433437
used_before_init = !0;
438+
erts_errno_init();
434439
}
435440

436441
if (0 <= eno && eno <= max_errno) {

0 commit comments

Comments
 (0)