Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ucs/sys/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ ucs_status_t ucs_socket_set_buffer_size(int fd, size_t sockopt_sndbuf,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: silent_bind reads broader than the behavior — only the EADDRINUSE case is silenced. Fine given the doc comment clarifies it, just flagging.


ucs_status_t ucs_socket_server_init(const struct sockaddr *saddr, socklen_t socklen,
int backlog, int silent_err_in_use,
int backlog, int silent_bind,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent parameter name. The header sock.h was renamed to silent_bind, but the .c definition still uses silent_err_in_use. This compiles (C ignores prototype vs. definition parameter-name mismatches), but the rename is incomplete and leaves the two files inconsistent, defeating the purpose of the PR.

Suggested change
int backlog, int silent_bind,
int backlog, int silent_bind,

Pls also rename the use on the errno == EADDRINUSE check below; the header already uses silent_bind, so the definition here is left inconsistent.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are talking about? I do just that!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the header was renamed to silent_bind but the definition here still uses silent_err_in_use. pls rename here too so the header and implementation match.

int reuse_addr, int *listen_fd)
{
int so_reuse_optval = 1;
Expand Down Expand Up @@ -493,7 +493,7 @@ ucs_status_t ucs_socket_server_init(const struct sockaddr *saddr, socklen_t sock

ret = bind(fd, saddr, socklen);
if (ret < 0) {
if ((errno == EADDRINUSE) && silent_err_in_use) {
if ((errno == EADDRINUSE) && silent_bind) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent parameter name; rename the use on the errno == EADDRINUSE check to match the header's silent_bind.

Suggested change
if ((errno == EADDRINUSE) && silent_bind) {
if ((errno == EADDRINUSE) && silent_bind) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are being silly, mr. Robot

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ((errno == EADDRINUSE) && silent_bind) {
if ((errno == EADDRINUSE) && silent_bind) {

complete the rename in the function body as well.

bind_log_level = UCS_LOG_LEVEL_DEBUG;
} else {
bind_log_level = UCS_LOG_LEVEL_ERROR;
Expand Down