Avoid segfault when pthread_key_create fails
authorGisle Aas <gisle@aas.no>
Wed, 5 Jan 2005 01:09:51 +0000 (17:09 -0800)
committerNicholas Clark <nick@ccl4.org>
Wed, 5 Jan 2005 11:25:29 +0000 (11:25 +0000)
Message-ID: <lracroz1gg.fsf@caliper.activestate.com>

p4raw-id: //depot/perl@23749

thread.h

index 93062c5..5de28fb 100644 (file)
--- a/thread.h
+++ b/thread.h
     STMT_START {                                               \
        int _eC_;                                               \
        if ((_eC_ = pthread_key_create(&PL_thr_key, 0))) {      \
-           PerlIO_printf(PerlIO_stderr(), "panic: pthread_key_create (%d) [%s:%d]",    \
-                                _eC_, __FILE__, __LINE__);     \
+            write(2, "panic: pthread_key_create failed\n", 33); \
            exit(1);                                            \
        }                                                       \
     } STMT_END