@@ -674,7 +674,7 @@ on_before_exec(PGconn *conn, PGcancel *thread_cancel_conn)
674
674
//elog(WARNING, "Handle tread_cancel_conn. on_before_exec");
675
675
old = thread_cancel_conn ;
676
676
677
- /* be sure handle_sigint doesn't use pointer while freeing */
677
+ /* be sure handle_interrupt doesn't use pointer while freeing */
678
678
thread_cancel_conn = NULL ;
679
679
680
680
if (old != NULL )
@@ -687,7 +687,7 @@ on_before_exec(PGconn *conn, PGcancel *thread_cancel_conn)
687
687
/* Free the old one if we have one */
688
688
old = cancel_conn ;
689
689
690
- /* be sure handle_sigint doesn't use pointer while freeing */
690
+ /* be sure handle_interrupt doesn't use pointer while freeing */
691
691
cancel_conn = NULL ;
692
692
693
693
if (old != NULL )
@@ -723,7 +723,7 @@ on_after_exec(PGcancel *thread_cancel_conn)
723
723
//elog(WARNING, "Handle tread_cancel_conn. on_after_exec");
724
724
old = thread_cancel_conn ;
725
725
726
- /* be sure handle_sigint doesn't use pointer while freeing */
726
+ /* be sure handle_interrupt doesn't use pointer while freeing */
727
727
thread_cancel_conn = NULL ;
728
728
729
729
if (old != NULL )
@@ -733,7 +733,7 @@ on_after_exec(PGcancel *thread_cancel_conn)
733
733
{
734
734
old = cancel_conn ;
735
735
736
- /* be sure handle_sigint doesn't use pointer while freeing */
736
+ /* be sure handle_interrupt doesn't use pointer while freeing */
737
737
cancel_conn = NULL ;
738
738
739
739
if (old != NULL )
@@ -937,15 +937,18 @@ wait_for_sockets(int nfds, fd_set *fds, struct timeval *timeout)
937
937
938
938
#ifndef WIN32
939
939
static void
940
- handle_sigint (SIGNAL_ARGS )
940
+ handle_interrupt (SIGNAL_ARGS )
941
941
{
942
942
on_interrupt ();
943
943
}
944
944
945
+ /* Handle various inrerruptions in the same way */
945
946
static void
946
947
init_cancel_handler (void )
947
948
{
948
- oldhandler = pqsignal (SIGINT , handle_sigint );
949
+ oldhandler = pqsignal (SIGINT , handle_interrupt );
950
+ pqsignal (SIGQUIT , handle_interrupt );
951
+ pqsignal (SIGTERM , handle_interrupt );
949
952
}
950
953
#else /* WIN32 */
951
954
0 commit comments