1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +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:
Tom Lane
2013-03-17 15:19:47 -04:00
parent 8c41cb695c
commit e2a203a190
3 changed files with 11 additions and 13 deletions

View File

@ -29,10 +29,12 @@
* neither POSIX signals nor BSD signals. The alternative is to do
* signal-handler reinstallation, which doesn't work well at all.
*
* Windows, of course, is resolutely in a class by itself. This file
* should not get compiled at all on Windows. We have an emulation of
* pqsignal() in src/backend/port/win32/signal.c for the backend
* environment; frontend programs are out of luck.
* Windows, of course, is resolutely in a class by itself. In the backend,
* we don't use this file at all; src/backend/port/win32/signal.c provides
* pqsignal() for the backend environment. Frontend programs can use
* 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>
#ifndef WIN32
#if !defined(WIN32) || defined(FRONTEND)
/*
* Set up a signal handler for signal "signo"
*
* Returns the previous handler. It's expected that the installed handler
* will persist across multiple deliveries of the signal (unlike the original
* POSIX definition of signal(2)).
* Returns the previous handler.
*/
pqsigfunc
pqsignal(int signo, pqsigfunc func)
@ -73,4 +73,4 @@ pqsignal(int signo, pqsigfunc func)
#endif /* !HAVE_POSIX_SIGNALS */
}
#endif /* WIN32 */
#endif /* !defined(WIN32) || defined(FRONTEND) */