socket: use name sockerr for socket error variables#21998
Closed
vszakats wants to merge 32 commits into
Closed
Conversation
sockerr for socket error variablessockerr for socket error variables
There was a problem hiding this comment.
Pull request overview
This PR standardizes naming for socket error variables by renaming many local error/err variables to sockerr across lib and test server code, and adds an explanatory comment for a deliberate sockerr = errno assignment in the socket connection filter.
Changes:
- Rename socket error variables to
sockerracross multiple test servers and library modules for consistency. - Update related logging/strerror call sites to use the renamed variable.
- Add an in-code comment in
lib/cf-socket.cexplaining whyerrno(notSOCKERRNO) is used in a specific failure path.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/server/util.c | Rename local socket error variable(s) to sockerr in unix-socket bind helper/daemon setup. |
| tests/server/tftpd.c | Rename socket error variable to sockerr in socket setup and error logging. |
| tests/server/sws.c | Rename socket error variables to sockerr in request handling, connect, accept, and server setup paths. |
| tests/server/socksd.c | Rename socket error variables; adjusts one cleanup-site local variable. |
| tests/server/sockfilt.c | Rename socket error variables to sockerr in juggle/select/accept and setup paths. |
| tests/server/rtspd.c | Rename socket error variables to sockerr in recv/listen/accept and setup paths. |
| tests/server/mqttd.c | Rename socket error variables to sockerr in select/accept and setup paths. |
| tests/server/dnsd.c | Rename socket error variables to sockerr in socket setup and error logging. |
| tests/libtest/first.h | Rename select() error variables in exe_select_test macro (ec → sockerr). |
| lib/tftp.c | Rename local socket error variable to sockerr in error handling path. |
| lib/telnet.c | Rename WinSock error variable to sockerr when reporting WSAEnumNetworkEvents failures. |
| lib/socketpair.c | Rename return/temporary socket error variable to sockerr in wakeup signaling. |
| lib/hostip4.c | Rename h_errnop-style variable to sockerr in gethostbyname_r resolver path. |
| lib/ftp.c | Rename local socket error variables to sockerr in FTP active-mode socket open/bind paths. |
| lib/cf-socket.c | Rename internal socket error state/parameter names to sockerr and add comment for errno assignment. |
| lib/asyn-thrdd.c | Rename threaded resolver item error field from sock_error to sockerr. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vszakats
added a commit
that referenced
this pull request
Jun 14, 2026
In `socksd` and `sws` error messages. Also: - show the messages only if `unlink()` failed. - rename a return code variable and sync a message text for consistency. Ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html Spotted by Copilot in `socksd.c` Bug: #21998 (comment) Follow-up to 80eb71a #8687 Closes #22005
vszakats
added a commit
that referenced
this pull request
Jun 14, 2026
- sws: fix socket error code in `select()` failure message. Spotted by Copilot Bug: #21998 (comment) - sws: do not call `SOCKERRNO` twice on error. - dnsd: do not call `SOCKERRNO` twice on error. - dnsd: replace `goto` with `while()` to sync with rest of code. - dnsd: `sendto()` fail message fixes: - replace `int` cast with `%zu` mask. - drop redundant newline. - show socket error string like rest of code. - report not-fully-sent error separately from socket errors. Closes #22007
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also:
sockerr = errno(vs.SOCKERRNO)assigment.