Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1131ba3

Browse files
committed
send() attempt for IDENT communication should retry on EINTR.
1 parenta7f6210 commit1131ba3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/libpq/hba.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.77 2001/11/05 17:46:25 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.78 2001/11/12 04:29:23 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -820,15 +820,19 @@ ident_inet(const struct in_addr remote_ip_addr,
820820
/* The query we send to the Ident server */
821821
snprintf(ident_query,80,"%d,%d\n",
822822
ntohs(remote_port),ntohs(local_port));
823-
rc=send(sock_fd,ident_query,strlen(ident_query),0);
823+
/* loop in case send is interrupted */
824+
do {
825+
rc=send(sock_fd,ident_query,strlen(ident_query),0);
826+
}while (rc<0&&errno==EINTR);
824827
if (rc<0)
825828
{
826829
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
827830
"Unable to send query to Ident server on the host which is "
828831
"trying to connect to Postgres (Host %s, Port %d),"
829832
"even though we successfully connected to it. "
830833
"errno = %s (%d)\n",
831-
inet_ntoa(remote_ip_addr),IDENT_PORT,strerror(errno),errno);
834+
inet_ntoa(remote_ip_addr),IDENT_PORT,
835+
strerror(errno),errno);
832836
fputs(PQerrormsg,stderr);
833837
pqdebug("%s",PQerrormsg);
834838
ident_return= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp