diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-12 04:29:23 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-12 04:29:23 +0000 |
commit | 1131ba3135e9435a529a15c60fc3806d4e1ae72f (patch) | |
tree | 6b386a5cc55ae8fafdaa250872e171f0d3b0726a /src | |
parent | a7f6210de2688afa6eb88853b3c3124a6d2248ef (diff) | |
download | postgresql-1131ba3135e9435a529a15c60fc3806d4e1ae72f.tar.gz postgresql-1131ba3135e9435a529a15c60fc3806d4e1ae72f.zip |
send() attempt for IDENT communication should retry on EINTR.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 7812f40097a..081fc4977cb 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.77 2001/11/05 17:46:25 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.78 2001/11/12 04:29:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -820,7 +820,10 @@ ident_inet(const struct in_addr remote_ip_addr, /* The query we send to the Ident server */ snprintf(ident_query, 80, "%d,%d\n", ntohs(remote_port), ntohs(local_port)); - rc = send(sock_fd, ident_query, strlen(ident_query), 0); + /* loop in case send is interrupted */ + do { + rc = send(sock_fd, ident_query, strlen(ident_query), 0); + } while (rc < 0 && errno == EINTR); if (rc < 0) { snprintf(PQerrormsg, PQERRORMSG_LENGTH, @@ -828,7 +831,8 @@ ident_inet(const struct in_addr remote_ip_addr, "trying to connect to Postgres (Host %s, Port %d)," "even though we successfully connected to it. " "errno = %s (%d)\n", - inet_ntoa(remote_ip_addr), IDENT_PORT, strerror(errno), errno); + inet_ntoa(remote_ip_addr), IDENT_PORT, + strerror(errno), errno); fputs(PQerrormsg, stderr); pqdebug("%s", PQerrormsg); ident_return = false; |