GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Auto-port 5.0: Fix implementation of strerror_r_xsi for GNU (#16562) · netty/netty@e78459d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport-native-unix-common/src/main/c
    • netty_unix_errors.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport-native-unix-common/src/main/c/netty_unix_errors.c‎

Copy file name to clipboardExpand all lines: transport-native-unix-common/src/main/c/netty_unix_errors.c
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ static jmethodID closedChannelExceptionMethodId = NULL;
4747
}
4848
#else
4949
static inline int strerror_r_xsi(int errnum, char *strerrbuf, size_t buflen) {
50+
// Clear errno before calling the GNU variant so we can reliably detect failure.
51+
// The GNU strerror_r only sets errno on error; it does not clear a pre-existing value,
52+
// so a stale non-zero errno would otherwise cause a false negative here.
53+
errno = 0;
5054
char* tmp = strerror_r(errnum, strerrbuf, buflen);
5155
if (strerrbuf[0] == '\0') {
5256
// Our output buffer was not used. Copy from tmp.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.