Skip to content

Commit 435d114

Browse files
committed
Merge branch 'master' into wal_delete_refactoring
2 parents 271d2d1 + 64d5467 commit 435d114

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/utils/pgut.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ on_before_exec(PGconn *conn, PGcancel *thread_cancel_conn)
674674
//elog(WARNING, "Handle tread_cancel_conn. on_before_exec");
675675
old = thread_cancel_conn;
676676

677-
/* be sure handle_sigint doesn't use pointer while freeing */
677+
/* be sure handle_interrupt doesn't use pointer while freeing */
678678
thread_cancel_conn = NULL;
679679

680680
if (old != NULL)
@@ -687,7 +687,7 @@ on_before_exec(PGconn *conn, PGcancel *thread_cancel_conn)
687687
/* Free the old one if we have one */
688688
old = cancel_conn;
689689

690-
/* be sure handle_sigint doesn't use pointer while freeing */
690+
/* be sure handle_interrupt doesn't use pointer while freeing */
691691
cancel_conn = NULL;
692692

693693
if (old != NULL)
@@ -723,7 +723,7 @@ on_after_exec(PGcancel *thread_cancel_conn)
723723
//elog(WARNING, "Handle tread_cancel_conn. on_after_exec");
724724
old = thread_cancel_conn;
725725

726-
/* be sure handle_sigint doesn't use pointer while freeing */
726+
/* be sure handle_interrupt doesn't use pointer while freeing */
727727
thread_cancel_conn = NULL;
728728

729729
if (old != NULL)
@@ -733,7 +733,7 @@ on_after_exec(PGcancel *thread_cancel_conn)
733733
{
734734
old = cancel_conn;
735735

736-
/* be sure handle_sigint doesn't use pointer while freeing */
736+
/* be sure handle_interrupt doesn't use pointer while freeing */
737737
cancel_conn = NULL;
738738

739739
if (old != NULL)
@@ -937,15 +937,18 @@ wait_for_sockets(int nfds, fd_set *fds, struct timeval *timeout)
937937

938938
#ifndef WIN32
939939
static void
940-
handle_sigint(SIGNAL_ARGS)
940+
handle_interrupt(SIGNAL_ARGS)
941941
{
942942
on_interrupt();
943943
}
944944

945+
/* Handle various inrerruptions in the same way */
945946
static void
946947
init_cancel_handler(void)
947948
{
948-
oldhandler = pqsignal(SIGINT, handle_sigint);
949+
oldhandler = pqsignal(SIGINT, handle_interrupt);
950+
pqsignal(SIGQUIT, handle_interrupt);
951+
pqsignal(SIGTERM, handle_interrupt);
949952
}
950953
#else /* WIN32 */
951954

0 commit comments

Comments
 (0)