Skip to content

Commit 0bc291e

Browse files
committed
Fix thinko (revealed by gcc warning).
1 parent 7739cde commit 0bc291e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/backend/libpq/pqcomm.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
* $Id: pqcomm.c,v 1.120 2001/08/07 10:44:15 petere Exp $
32+
* $Id: pqcomm.c,v 1.121 2001/08/07 15:55:16 tgl Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -706,9 +706,13 @@ pq_eof(void)
706706

707707
res = recv(MyProcPort->sock, &x, 1, MSG_PEEK);
708708

709-
if (res == -1)
709+
if (res < 0)
710+
{
711+
/* don't try to elog here... */
710712
fprintf(stderr, "pq_eof: recv() failed: %s\n", strerror(errno));
711-
else if (res == 0)
713+
return EOF;
714+
}
715+
if (res == 0)
712716
return EOF;
713717
else
714718
return 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy