Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2a203a

Browse files
committed
initdb needs pqsignal() even on Windows.
I had thought we weren't using this version of pqsignal() at all onWindows, but that's wrong --- initdb is using it (and coping with thePOSIX-ish semantics of bare signal() :-(). So allow the file to bebuilt in WIN32+FRONTEND case, and add it to the MSVC build logic.
1 parent8c41cb6 commite2a203a

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

‎src/include/port.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,8 @@ extern intpg_check_dir(const char *dir);
463463
externintpg_mkdir_p(char*path,intomode);
464464

465465
/* port/pqsignal.c */
466-
/* On Windows, we can emulate pqsignal in the backend, but not frontend */
467-
#if !defined(WIN32)|| !defined(FRONTEND)
468466
typedefvoid (*pqsigfunc) (intsigno);
469467
externpqsigfuncpqsignal(intsigno,pqsigfuncfunc);
470-
#endif
471468

472469
/* port/quotes.c */
473470
externchar*escape_single_quotes_ascii(constchar*src);

‎src/port/pqsignal.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@
2929
*neither POSIX signals nor BSD signals.The alternative is to do
3030
*signal-handler reinstallation, which doesn't work well at all.
3131
*
32-
*Windows, of course, is resolutely in a class by itself. This file
33-
*should not get compiled at all on Windows. We have an emulation of
34-
*pqsignal() in src/backend/port/win32/signal.c for the backend
35-
*environment; frontend programs are out of luck.
32+
*Windows, of course, is resolutely in a class by itself. In the backend,
33+
*we don't use this file at all; src/backend/port/win32/signal.c provides
34+
*pqsignal() for the backend environment. Frontend programs can use
35+
*this version of pqsignal() if they wish, but beware that Windows
36+
*requires signal-handler reinstallation, because indeed it provides
37+
*neither POSIX signals nor BSD signals :-(
3638
* ------------------------------------------------------------------------
3739
*/
3840

3941
#include"c.h"
4042

4143
#include<signal.h>
4244

43-
#ifndefWIN32
45+
#if !defined(WIN32)|| defined(FRONTEND)
4446

4547
/*
4648
* Set up a signal handler for signal "signo"
4749
*
48-
* Returns the previous handler. It's expected that the installed handler
49-
* will persist across multiple deliveries of the signal (unlike the original
50-
* POSIX definition of signal(2)).
50+
* Returns the previous handler.
5151
*/
5252
pqsigfunc
5353
pqsignal(intsigno,pqsigfuncfunc)
@@ -73,4 +73,4 @@ pqsignal(int signo, pqsigfunc func)
7373
#endif/* !HAVE_POSIX_SIGNALS */
7474
}
7575

76-
#endif/* WIN32 */
76+
#endif/*!defined(WIN32) || defined(FRONTEND) */

‎src/tools/msvc/Mkvcbuild.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ sub mkvcbuild
6969
chklocale.c crypt.c fls.c fseeko.c getrusage.c inet_aton.c random.c
7070
srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
7171
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c exec.c noblock.c path.c
72-
pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c qsort.c qsort_arg.c quotes.c
72+
pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c
73+
qsort.c qsort_arg.c quotes.c
7374
sprompt.c tar.c thread.c wait_error.c getopt.c getopt_long.c dirent.c rint.c win32env.c
7475
win32error.c win32setlocale.c);
7576

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp