1- From 39352d9d7494b6a22b263bcf68fea8ec0731a4e0 Mon Sep 17 00:00:00 2001
1+ From 1c80560af2195e1896ade0b0772055c956ad4a3e Mon Sep 17 00:00:00 2001
22From: Elvis Pranskevichus <elvis@edgedb.com>
33Date: Fri, 15 Jul 2022 16:44:07 -0700
44Subject: [PATCH] Add a workaround for WSL1 signal mishandling
@@ -22,23 +22,23 @@ See https://github.com/microsoft/WSL/issues/8619
2222 9 files changed, 52 insertions(+), 1 deletion(-)
2323
2424diff --git a/configure b/configure
25- index 6db03e4a22..78db894968 100755
25+ index b1442afe4c1..68dc920001c 100755
2626--- a/configure
2727+++ b/configure
28- @@ -13338 ,7 +13338 ,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
29- fi
30-
28+ @@ -13349 ,7 +13349 ,7 @@ fi
29+ ## Header files
30+ ##
3131
3232- for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h sys/epoll.h sys/event.h sys/personality.h sys/prctl.h sys/procctl.h sys/signalfd.h sys/ucred.h termios.h ucred.h
3333+ for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h sys/epoll.h sys/event.h sys/personality.h sys/prctl.h sys/procctl.h sys/signalfd.h sys/ucred.h sys/utsname.h termios.h ucred.h
3434 do :
3535 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
3636 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
3737diff --git a/configure.ac b/configure.ac
38- index 7531366b75..791ec2579c 100644
38+ index 6f0230b0bf5..0781c188a0c 100644
3939--- a/configure.ac
4040+++ b/configure.ac
41- @@ -1473 ,6 +1473 ,7 @@ AC_CHECK_HEADERS(m4_normalize([
41+ @@ -1478 ,6 +1478 ,7 @@ AC_CHECK_HEADERS(m4_normalize([
4242 sys/procctl.h
4343 sys/signalfd.h
4444 sys/ucred.h
@@ -47,7 +47,7 @@ index 7531366b75..791ec2579c 100644
4747 ucred.h
4848 ]))
4949diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
50- index bf0241aed0..157559c6e1 100644
50+ index d032091495b..a29688dde82 100644
5151--- a/src/backend/postmaster/postmaster.c
5252+++ b/src/backend/postmaster/postmaster.c
5353@@ -77,6 +77,10 @@
@@ -81,7 +81,7 @@ index bf0241aed0..157559c6e1 100644
8181 /*
8282 * Establish input sockets.
8383 *
84- @@ -2068 ,6 +2078 ,31 @@ InitProcessGlobals(void)
84+ @@ -2069 ,6 +2079 ,31 @@ InitProcessGlobals(void)
8585 }
8686
8787 /*
@@ -114,7 +114,7 @@ index bf0241aed0..157559c6e1 100644
114114 * SIGUSR1 to ask postmaster to check for logrotate and promote files.
115115 */
116116diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c
117- index 608eb66abe..349bd2a5ad 100644
117+ index 2b4ded38893..84965ca6f93 100644
118118--- a/src/backend/storage/ipc/latch.c
119119+++ b/src/backend/storage/ipc/latch.c
120120@@ -334,6 +334,10 @@ InitializeLatchSupport(void)
@@ -129,7 +129,7 @@ index 608eb66abe..349bd2a5ad 100644
129129
130130 #ifdef WAIT_USE_KQUEUE
131131diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
132- index cc61937eef..f46d039f26 100644
132+ index cc61937eef7..f46d039f266 100644
133133--- a/src/backend/utils/init/globals.c
134134+++ b/src/backend/utils/init/globals.c
135135@@ -117,6 +117,11 @@ bool IsPostmasterEnvironment = false;
@@ -145,10 +145,10 @@ index cc61937eef..f46d039f26 100644
145145
146146 int DateStyle = USE_ISO_DATES;
147147diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
148- index 537d92c0cf..8052e393f5 100644
148+ index 8ac8ecc0dbb..33ee69ae74c 100644
149149--- a/src/backend/utils/init/miscinit.c
150150+++ b/src/backend/utils/init/miscinit.c
151- @@ -130 ,6 +130 ,7 @@ InitPostmasterChild(void)
151+ @@ -131 ,6 +131 ,7 @@ InitPostmasterChild(void)
152152 /* In EXEC_BACKEND case we will not have inherited BlockSig etc values */
153153 #ifdef EXEC_BACKEND
154154 pqinitmask();
@@ -157,7 +157,7 @@ index 537d92c0cf..8052e393f5 100644
157157
158158 /* Initialize process-local latch support */
159159diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
160- index 90f9b21b25..071aa8d3db 100644
160+ index 0d563465935..a704f1c201c 100644
161161--- a/src/include/miscadmin.h
162162+++ b/src/include/miscadmin.h
163163@@ -166,6 +166,7 @@ extern PGDLLIMPORT pid_t PostmasterPid;
@@ -169,10 +169,10 @@ index 90f9b21b25..071aa8d3db 100644
169169 extern PGDLLIMPORT bool ExitOnAnyError;
170170
171171diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
172- index 6d9a0d001f..66850edc9d 100644
172+ index 0ee4a63eaa6..dcdeb1bc6d3 100644
173173--- a/src/include/pg_config.h.in
174174+++ b/src/include/pg_config.h.in
175- @@ -465 ,6 +465 ,9 @@
175+ @@ -463 ,6 +463 ,9 @@
176176 /* Define to 1 if you have the <sys/ucred.h> header file. */
177177 #undef HAVE_SYS_UCRED_H
178178
@@ -183,7 +183,7 @@ index 6d9a0d001f..66850edc9d 100644
183183 #undef HAVE_TERMIOS_H
184184
185185diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h
186- index 89ad13b788..b8338af449 100644
186+ index 89ad13b788b..b8338af4495 100644
187187--- a/src/include/postmaster/postmaster.h
188188+++ b/src/include/postmaster/postmaster.h
189189@@ -57,6 +57,7 @@ extern PGDLLIMPORT bool LoadedSSL;
@@ -195,5 +195,5 @@ index 89ad13b788..b8338af449 100644
195195 extern int MaxLivePostmasterChildren(void);
196196
197197- -
198- 2.45.2
198+ 2.49.0
199199
0 commit comments