X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/3d1c4d8b006d0c1d01e22169a4db20c266592baf..375ed12a42c6092b1af1d8e395bf3dadd9a66e48:/dist/threads/threads.xs diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs index b3e10f0..182cd37 100644 --- a/dist/threads/threads.xs +++ b/dist/threads/threads.xs @@ -714,8 +714,11 @@ S_ithread_create( PERL_SET_CONTEXT(aTHX); if (!thread) { MUTEX_UNLOCK(&MY_POOL.create_destruct_mutex); - (void)PerlLIO_write(PerlIO_fileno(Perl_error_log), - PL_no_mem, strlen(PL_no_mem)); + int fd = PerlIO_fileno(Perl_error_log); + if (fd >= 0) { + /* If there's no error_log, we cannot scream about it missing. */ + PERL_UNUSED_RESULT(PerlLIO_write(fd, PL_no_mem, strlen(PL_no_mem))); + } my_exit(1); } Zero(thread, 1, ithread);