aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-08-07 15:55:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-08-07 15:55:16 +0000
commit0bc291e03cbd0b46414288ea5c94ac5b5a8769fa (patch)
tree56a118b4c44985388c4f1e7d37b4f6bcb5853aae /src
parent7739cde4f6727615378092876a79ac6ef6d6e96a (diff)
downloadpostgresql-0bc291e03cbd0b46414288ea5c94ac5b5a8769fa.tar.gz
postgresql-0bc291e03cbd0b46414288ea5c94ac5b5a8769fa.zip
Fix thinko (revealed by gcc warning).
Diffstat (limited to 'src')
-rw-r--r--src/backend/libpq/pqcomm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index e5d6c1f7b0f..b588f09a07e 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqcomm.c,v 1.120 2001/08/07 10:44:15 petere Exp $
+ * $Id: pqcomm.c,v 1.121 2001/08/07 15:55:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -706,9 +706,13 @@ pq_eof(void)
res = recv(MyProcPort->sock, &x, 1, MSG_PEEK);
- if (res == -1)
+ if (res < 0)
+ {
+ /* don't try to elog here... */
fprintf(stderr, "pq_eof: recv() failed: %s\n", strerror(errno));
- else if (res == 0)
+ return EOF;
+ }
+ if (res == 0)
return EOF;
else
return 0;