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

Commitc981879

Browse files
committed
Don't bother to set sockaddr_un.sun_len.
It's not necessary to fill in sun_len when calling bind() or connect(),on all known systems that have it.Discussion:https://postgr.es/m/2781112.1644819528%40sss.pgh.pa.us
1 parentf972ec5 commitc981879

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

‎src/common/ip.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,6 @@ getaddrinfo_unix(const char *path, const struct addrinfo *hintsp,
218218
aip->ai_addrlen= offsetof(structsockaddr_un,sun_path)+strlen(path);
219219
}
220220

221-
/*
222-
* The standard recommendation for filling sun_len is to set it to the
223-
* struct size (independently of the actual path length). However, that
224-
* draws an integer-overflow warning on AIX 7.1, where sun_len is just
225-
* uint8 yet the struct size exceeds 255 bytes. It's likely that nothing
226-
* is paying attention to sun_len on that platform, but we have to do
227-
* something with it. To suppress the warning, clamp the struct size to
228-
* what will fit in sun_len.
229-
*/
230-
#ifdefHAVE_STRUCT_SOCKADDR_SA_LEN
231-
unp->sun_len=Min(sizeof(structsockaddr_un),
232-
((size_t)1 << (sizeof(unp->sun_len)*BITS_PER_BYTE))-1);
233-
#endif
234-
235221
return0;
236222
}
237223

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp