mirror of
https://github.com/postgres/postgres.git
synced 2025-07-23 03:21:12 +03:00
initdb needs pqsignal() even on Windows.
I had thought we weren't using this version of pqsignal() at all on Windows, but that's wrong --- initdb is using it (and coping with the POSIX-ish semantics of bare signal() :-(). So allow the file to be built in WIN32+FRONTEND case, and add it to the MSVC build logic.
This commit is contained in:
@ -463,11 +463,8 @@ extern int pg_check_dir(const char *dir);
|
|||||||
extern int pg_mkdir_p(char *path, int omode);
|
extern int pg_mkdir_p(char *path, int omode);
|
||||||
|
|
||||||
/* port/pqsignal.c */
|
/* port/pqsignal.c */
|
||||||
/* On Windows, we can emulate pqsignal in the backend, but not frontend */
|
|
||||||
#if !defined(WIN32) || !defined(FRONTEND)
|
|
||||||
typedef void (*pqsigfunc) (int signo);
|
typedef void (*pqsigfunc) (int signo);
|
||||||
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
|
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* port/quotes.c */
|
/* port/quotes.c */
|
||||||
extern char *escape_single_quotes_ascii(const char *src);
|
extern char *escape_single_quotes_ascii(const char *src);
|
||||||
|
@ -29,10 +29,12 @@
|
|||||||
* neither POSIX signals nor BSD signals. The alternative is to do
|
* neither POSIX signals nor BSD signals. The alternative is to do
|
||||||
* signal-handler reinstallation, which doesn't work well at all.
|
* signal-handler reinstallation, which doesn't work well at all.
|
||||||
*
|
*
|
||||||
* Windows, of course, is resolutely in a class by itself. This file
|
* Windows, of course, is resolutely in a class by itself. In the backend,
|
||||||
* should not get compiled at all on Windows. We have an emulation of
|
* we don't use this file at all; src/backend/port/win32/signal.c provides
|
||||||
* pqsignal() in src/backend/port/win32/signal.c for the backend
|
* pqsignal() for the backend environment. Frontend programs can use
|
||||||
* environment; frontend programs are out of luck.
|
* this version of pqsignal() if they wish, but beware that Windows
|
||||||
|
* requires signal-handler reinstallation, because indeed it provides
|
||||||
|
* neither POSIX signals nor BSD signals :-(
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -40,14 +42,12 @@
|
|||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#if !defined(WIN32) || defined(FRONTEND)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up a signal handler for signal "signo"
|
* Set up a signal handler for signal "signo"
|
||||||
*
|
*
|
||||||
* Returns the previous handler. It's expected that the installed handler
|
* Returns the previous handler.
|
||||||
* will persist across multiple deliveries of the signal (unlike the original
|
|
||||||
* POSIX definition of signal(2)).
|
|
||||||
*/
|
*/
|
||||||
pqsigfunc
|
pqsigfunc
|
||||||
pqsignal(int signo, pqsigfunc func)
|
pqsignal(int signo, pqsigfunc func)
|
||||||
@ -73,4 +73,4 @@ pqsignal(int signo, pqsigfunc func)
|
|||||||
#endif /* !HAVE_POSIX_SIGNALS */
|
#endif /* !HAVE_POSIX_SIGNALS */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* WIN32 */
|
#endif /* !defined(WIN32) || defined(FRONTEND) */
|
||||||
|
@ -69,7 +69,8 @@ sub mkvcbuild
|
|||||||
chklocale.c crypt.c fls.c fseeko.c getrusage.c inet_aton.c random.c
|
chklocale.c crypt.c fls.c fseeko.c getrusage.c inet_aton.c random.c
|
||||||
srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
|
srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
|
||||||
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c exec.c noblock.c path.c
|
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c exec.c noblock.c path.c
|
||||||
pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c qsort.c qsort_arg.c quotes.c
|
pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c
|
||||||
|
qsort.c qsort_arg.c quotes.c
|
||||||
sprompt.c tar.c thread.c wait_error.c getopt.c getopt_long.c dirent.c rint.c win32env.c
|
sprompt.c tar.c thread.c wait_error.c getopt.c getopt_long.c dirent.c rint.c win32env.c
|
||||||
win32error.c win32setlocale.c);
|
win32error.c win32setlocale.c);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user