@@ -620,10 +620,10 @@ PostmasterMain(int argc, char *argv[])
620
620
* is used by all child processes and client processes). That has a
621
621
* couple of special behaviors:
622
622
*
623
- * 1. Except on Windows, we tell sigaction() to block all signals for the
624
- * duration of the signal handler. This is faster than our old approach
625
- * of blocking/unblocking explicitly in the signal handler, and it should
626
- * also prevent excessive stack consumption if signals arrive quickly.
623
+ * 1. We tell sigaction() to block all signals for the duration of the
624
+ * signal handler. This is faster than our old approach of
625
+ * blocking/unblocking explicitly in the signal handler, and it should also
626
+ * prevent excessive stack consumption if signals arrive quickly.
627
627
*
628
628
* 2. We do not set the SA_RESTART flag. This is because signals will be
629
629
* blocked at all times except when ServerLoop is waiting for something to
@@ -2726,14 +2726,6 @@ SIGHUP_handler(SIGNAL_ARGS)
2726
2726
{
2727
2727
int save_errno = errno ;
2728
2728
2729
- /*
2730
- * We rely on the signal mechanism to have blocked all signals ... except
2731
- * on Windows, which lacks sigaction(), so we have to do it manually.
2732
- */
2733
- #ifdef WIN32
2734
- PG_SETMASK (& BlockSig );
2735
- #endif
2736
-
2737
2729
if (Shutdown <= SmartShutdown )
2738
2730
{
2739
2731
ereport (LOG ,
@@ -2790,10 +2782,6 @@ SIGHUP_handler(SIGNAL_ARGS)
2790
2782
#endif
2791
2783
}
2792
2784
2793
- #ifdef WIN32
2794
- PG_SETMASK (& UnBlockSig );
2795
- #endif
2796
-
2797
2785
errno = save_errno ;
2798
2786
}
2799
2787
@@ -2806,14 +2794,6 @@ pmdie(SIGNAL_ARGS)
2806
2794
{
2807
2795
int save_errno = errno ;
2808
2796
2809
- /*
2810
- * We rely on the signal mechanism to have blocked all signals ... except
2811
- * on Windows, which lacks sigaction(), so we have to do it manually.
2812
- */
2813
- #ifdef WIN32
2814
- PG_SETMASK (& BlockSig );
2815
- #endif
2816
-
2817
2797
ereport (DEBUG2 ,
2818
2798
(errmsg_internal ("postmaster received signal %d" ,
2819
2799
postgres_signal_arg )));
@@ -2938,10 +2918,6 @@ pmdie(SIGNAL_ARGS)
2938
2918
break ;
2939
2919
}
2940
2920
2941
- #ifdef WIN32
2942
- PG_SETMASK (& UnBlockSig );
2943
- #endif
2944
-
2945
2921
errno = save_errno ;
2946
2922
}
2947
2923
@@ -2955,14 +2931,6 @@ reaper(SIGNAL_ARGS)
2955
2931
int pid ; /* process id of dead child process */
2956
2932
int exitstatus ; /* its exit status */
2957
2933
2958
- /*
2959
- * We rely on the signal mechanism to have blocked all signals ... except
2960
- * on Windows, which lacks sigaction(), so we have to do it manually.
2961
- */
2962
- #ifdef WIN32
2963
- PG_SETMASK (& BlockSig );
2964
- #endif
2965
-
2966
2934
ereport (DEBUG4 ,
2967
2935
(errmsg_internal ("reaping dead processes" )));
2968
2936
@@ -3255,11 +3223,6 @@ reaper(SIGNAL_ARGS)
3255
3223
*/
3256
3224
PostmasterStateMachine ();
3257
3225
3258
- /* Done with signal handler */
3259
- #ifdef WIN32
3260
- PG_SETMASK (& UnBlockSig );
3261
- #endif
3262
-
3263
3226
errno = save_errno ;
3264
3227
}
3265
3228
@@ -5106,14 +5069,6 @@ sigusr1_handler(SIGNAL_ARGS)
5106
5069
{
5107
5070
int save_errno = errno ;
5108
5071
5109
- /*
5110
- * We rely on the signal mechanism to have blocked all signals ... except
5111
- * on Windows, which lacks sigaction(), so we have to do it manually.
5112
- */
5113
- #ifdef WIN32
5114
- PG_SETMASK (& BlockSig );
5115
- #endif
5116
-
5117
5072
/*
5118
5073
* RECOVERY_STARTED and BEGIN_HOT_STANDBY signals are ignored in
5119
5074
* unexpected states. If the startup process quickly starts up, completes
@@ -5254,10 +5209,6 @@ sigusr1_handler(SIGNAL_ARGS)
5254
5209
signal_child (StartupPID , SIGUSR2 );
5255
5210
}
5256
5211
5257
- #ifdef WIN32
5258
- PG_SETMASK (& UnBlockSig );
5259
- #endif
5260
-
5261
5212
errno = save_errno ;
5262
5213
}
5263
5214
0 commit comments