summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-print.c
diff options
context:
space:
mode:
authorBruce Momjian2005-08-23 20:48:47 +0000
committerBruce Momjian2005-08-23 20:48:47 +0000
commita970a8cb95bd3f4d3a4b924904d248c9dd322ee0 (patch)
tree4fbb5211d2a35c9e86323d1907deaf2bf63a6be2 /src/interfaces/libpq/fe-print.c
parenteef7e30cc13158cb1fde7f4b148dd14e83331a35 (diff)
Back out incorrect commit.
Diffstat (limited to 'src/interfaces/libpq/fe-print.c')
-rw-r--r--src/interfaces/libpq/fe-print.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c
index 33882d8ca79..38bc1ceee6c 100644
--- a/src/interfaces/libpq/fe-print.c
+++ b/src/interfaces/libpq/fe-print.c
@@ -10,7 +10,7 @@
* didn't really belong there.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.61 2005/08/23 20:45:07 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.62 2005/08/23 20:48:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,7 +88,7 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
int total_line_length = 0;
int usePipe = 0;
char *pagerenv;
-#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
+#ifdef ENABLE_THREAD_SAFETY
sigset_t osigset;
bool sigpipe_masked = false;
bool sigpipe_pending;
@@ -189,14 +189,14 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
if (fout)
{
usePipe = 1;
-#ifndef WIN32
#ifdef ENABLE_THREAD_SAFETY
if (pq_block_sigpipe(&osigset, &sigpipe_pending) == 0)
sigpipe_masked = true;
#else
+#ifndef WIN32
oldsigpipehandler = pqsignal(SIGPIPE, SIG_IGN);
-#endif /* ENABLE_THREAD_SAFETY */
-#endif /* WIN32 */
+#endif
+#endif
}
else
fout = stdout;
@@ -311,15 +311,16 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
_pclose(fout);
#else
pclose(fout);
-
+#endif
#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
+#ifndef WIN32
pqsignal(SIGPIPE, oldsigpipehandler);
-#endif /* ENABLE_THREAD_SAFETY */
-#endif /* WIN32 */
+#endif
+#endif
}
if (po->html3 && !po->expanded)
fputs("</table>\n", fout);