summaryrefslogtreecommitdiff
path: root/user/open-vm-tools/strerror_r.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/open-vm-tools/strerror_r.patch')
-rw-r--r--user/open-vm-tools/strerror_r.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/user/open-vm-tools/strerror_r.patch b/user/open-vm-tools/strerror_r.patch
new file mode 100644
index 000000000..05de85f7a
--- /dev/null
+++ b/user/open-vm-tools/strerror_r.patch
@@ -0,0 +1,25 @@
+--- open-vm-tools-12.4.0-23259341/lib/err/errPosix.c.old 2024-02-06 09:08:54.000000000 -0600
++++ open-vm-tools-12.4.0-23259341/lib/err/errPosix.c 2024-05-22 13:58:47.578938258 -0500
+@@ -29,6 +29,7 @@
+ #endif
+
+ #include <errno.h>
++#include <stdio.h>
+ #include <string.h>
+ #include <locale.h>
+
+@@ -63,10 +64,12 @@
+ {
+ char *p;
+
+-#if defined(__linux__) && !defined(__ANDROID__)
++#if defined(__linux__) && defined(__GLIBC__)
+ p = strerror_r(errorNumber, buf, bufSize);
+ #else
+- p = strerror(errorNumber);
++ if(strerror_r(errorNumber, buf, bufSize) != 0)
++ snprintf(buf, bufSize, "unknown error %i", errorNumber);
++ p = buf;
+ #endif
+ ASSERT(p != NULL);
+ return p;