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

Commit01226c6

Browse files
committed
Avoid use of Perl getprotobyname
getprotobyname returns undefined on some CI machines. It's not clearwhy. The code overall still works, but it raises a warning.In PostgreSQL C code, we always call socket() with 0 for the protocolargument, so we should be able to do the same in Perl (since the Perldocumentation says that the arguments of the socket function are thesame as in C). So do that, to avoid the issue.Reviewed-by: Andrew Dunstan <andrew@dunslane.net>Discussion:https://www.postgresql.org/message-id/flat/06f899fd-1826-05ab-42d6-adeb1fd5e200%40eisentraut.org
1 parentbf8bf6d commit01226c6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,8 @@ sub can_bind
15701570
my ($host,$port) =@_;
15711571
my$iaddr = inet_aton($host);
15721572
my$paddr = sockaddr_in($port,$iaddr);
1573-
my$proto =getprotobyname("tcp");
15741573

1575-
socket(SOCK, PF_INET, SOCK_STREAM,$proto)
1574+
socket(SOCK, PF_INET, SOCK_STREAM,0)
15761575
ordie"socket failed:$!";
15771576

15781577
# As in postmaster, don't use SO_REUSEADDR on Windows

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp