Index: src/interfaces/libpq/fe-secure.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/fe-secure.c,v retrieving revision 1.37 diff -c -r1.37 fe-secure.c *** src/interfaces/libpq/fe-secure.c 10 Feb 2004 15:21:24 -0000 1.37 --- src/interfaces/libpq/fe-secure.c 14 Mar 2004 08:31:48 -0000 *************** *** 1077,1096 **** pqsigfunc pipehandler; /* * If the app hasn't set a SIGPIPE handler, define our own * that ignores SIGPIPE on libpq send() and does SIG_DFL * for other SIGPIPE cases. */ pipehandler = pqsignalinquire(SIGPIPE); if (pipehandler == SIG_DFL) /* not set by application */ - { - /* - * Create key first because the signal handler might be called - * right after being installed. - */ - pthread_key_create(&thread_in_send, NULL); pqsignal(SIGPIPE, sigpipe_handler_ignore_send); - } } /* --- 1077,1096 ---- pqsigfunc pipehandler; /* + * Always create the key for SIGPIPE handling - PQinSend needs + * it. Create it first because the signal handler might be called + * right after being installed. + */ + pthread_key_create(&thread_in_send, NULL); + + /* * If the app hasn't set a SIGPIPE handler, define our own * that ignores SIGPIPE on libpq send() and does SIG_DFL * for other SIGPIPE cases. */ pipehandler = pqsignalinquire(SIGPIPE); if (pipehandler == SIG_DFL) /* not set by application */ pqsignal(SIGPIPE, sigpipe_handler_ignore_send); } /*