mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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.
This commit is contained in:
@@ -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 */
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user