diff options
author | Thomas Munro <tmunro@postgresql.org> | 2023-07-12 06:20:37 +1200 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2023-07-12 08:20:43 +1200 |
commit | 68a4b58eca032916e2aad78d63f717dcb147e906 (patch) | |
tree | d944d9ffb794df9d70c6408475f20d20a0580080 /src/interfaces/libpq/fe-print.c | |
parent | 11f36694091c97318e5a2bd28b35ffe9aa1c3b6a (diff) | |
download | postgresql-68a4b58eca032916e2aad78d63f717dcb147e906.tar.gz postgresql-68a4b58eca032916e2aad78d63f717dcb147e906.zip |
Remove --disable-thread-safety and related code.
All supported computers have either POSIX or Windows threads, and we no
longer have any automated testing of --disable-thread-safety. We define
a vestigial ENABLE_THREAD_SAFETY macro to 1 in ecpg_config.h in case it
is useful, but we no longer test it anywhere in PostgreSQL code, and
associated dead code paths are removed.
The Meson and perl-based Windows build scripts never had an equivalent
build option.
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CA%2BhUKGLtmexrpMtxBRLCVePqV_dtWG-ZsEbyPrYc%2BNBB2TkNsw%40mail.gmail.com
Diffstat (limited to 'src/interfaces/libpq/fe-print.c')
-rw-r--r-- | src/interfaces/libpq/fe-print.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index 40620b47e94..8af15032be7 100644 --- a/src/interfaces/libpq/fe-print.c +++ b/src/interfaces/libpq/fe-print.c @@ -88,14 +88,11 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po) bool usePipe = false; char *pagerenv; -#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32) +#if !defined(WIN32) sigset_t osigset; bool sigpipe_masked = false; bool sigpipe_pending; #endif -#if !defined(ENABLE_THREAD_SAFETY) && !defined(WIN32) - pqsigfunc oldsigpipehandler = NULL; -#endif #ifdef TIOCGWINSZ struct winsize screen_size; @@ -186,12 +183,8 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po) { usePipe = true; #ifndef WIN32 -#ifdef ENABLE_THREAD_SAFETY if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0) sigpipe_masked = true; -#else - oldsigpipehandler = pqsignal(SIGPIPE, SIG_IGN); -#endif /* ENABLE_THREAD_SAFETY */ #endif /* WIN32 */ } else @@ -324,13 +317,9 @@ exit: #else pclose(fout); -#ifdef ENABLE_THREAD_SAFETY /* we can't easily verify if EPIPE occurred, so say it did */ if (sigpipe_masked) pq_reset_sigpipe(&osigset, sigpipe_pending, true); -#else - pqsignal(SIGPIPE, oldsigpipehandler); -#endif /* ENABLE_THREAD_SAFETY */ #endif /* WIN32 */ } } |