diff options
| author | Tom Lane | 2013-03-17 16:06:42 +0000 |
|---|---|---|
| committer | Tom Lane | 2013-03-17 16:06:42 +0000 |
| commit | da5aeccf64b37a8e9bd3cb605848590595dbcbf8 (patch) | |
| tree | 5e16817356f6ae9b0bc3bf29a7d814da9a40bf8a /src/include | |
| parent | d43837d03067487560af481474ae985df894f786 (diff) | |
Move pqsignal() to libpgport.
We had two copies of this function in the backend and libpq, which was
already pretty bogus, but it turns out that we need it in some other
programs that don't use libpq (such as pg_test_fsync). So put it where
it probably should have been all along. The signal-mask-initialization
support in src/backend/libpq/pqsignal.c stays where it is, though, since
we only need that in the backend.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/libpq/pqsignal.h | 11 | ||||
| -rw-r--r-- | src/include/port.h | 7 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/include/libpq/pqsignal.h b/src/include/libpq/pqsignal.h index bc0bcef040..1889dca4b9 100644 --- a/src/include/libpq/pqsignal.h +++ b/src/include/libpq/pqsignal.h @@ -1,18 +1,13 @@ /*------------------------------------------------------------------------- * * pqsignal.h - * prototypes for the reliable BSD-style signal(2) routine. - * + * Backend signal(2) support (see also src/port/pqsignal.c) * * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/pqsignal.h * - * NOTES - * This shouldn't be in libpq, but the monitor and some other - * things need it... - * *------------------------------------------------------------------------- */ #ifndef PQSIGNAL_H @@ -42,10 +37,6 @@ int pqsigsetmask(int mask); #define sigdelset(set, signum) (*(set) &= ~(sigmask(signum))) #endif /* not HAVE_SIGPROCMASK */ -typedef void (*pqsigfunc) (int); - extern void pqinitmask(void); -extern pqsigfunc pqsignal(int signo, pqsigfunc func); - #endif /* PQSIGNAL_H */ diff --git a/src/include/port.h b/src/include/port.h index c5d0e0a970..cde4ad5607 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -462,6 +462,13 @@ extern int pg_check_dir(const char *dir); /* port/pgmkdirp.c */ extern int pg_mkdir_p(char *path, int omode); +/* 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); +extern pqsigfunc pqsignal(int signo, pqsigfunc func); +#endif + /* port/quotes.c */ extern char *escape_single_quotes_ascii(const char *src); |
