Fix thinko (revealed by gcc warning).

This commit is contained in:
Tom Lane 2001-08-07 15:55:16 +00:00
parent 7739cde4f6
commit 0bc291e03c
1 changed files with 7 additions and 3 deletions

View File

@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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); 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)); fprintf(stderr, "pq_eof: recv() failed: %s\n", strerror(errno));
else if (res == 0) return EOF;
}
if (res == 0)
return EOF; return EOF;
else else
return 0; return 0;