diff options
Diffstat (limited to 'meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch')
-rw-r--r-- | meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch new file mode 100644 index 0000000000..a6638adb9a --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch @@ -0,0 +1,44 @@ +From 666a043be7d6fe07a36599260f7214cbd29a79e7 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 13 Jun 2018 23:16:53 -0700 +Subject: [PATCH] use posix strerror_r unless on gnu libc system + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/lib/err/errPosix.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/open-vm-tools/lib/err/errPosix.c b/open-vm-tools/lib/err/errPosix.c +index c81b4c13f..7a4036402 100644 +--- a/open-vm-tools/lib/err/errPosix.c ++++ b/open-vm-tools/lib/err/errPosix.c +@@ -31,6 +31,7 @@ + #include <errno.h> + #include <string.h> + #include <locale.h> ++#include <stdio.h> + + #include "vmware.h" + #include "errInt.h" +@@ -63,11 +64,13 @@ ErrErrno2String(Err_Number errorNumber, // IN + { + char *p; + +-#if defined(__linux__) && !defined(__ANDROID__) ++#if defined(__GLIBC__) && !defined(__ANDROID__) + p = strerror_r(errorNumber, buf, bufSize); + #else +- p = strerror(errorNumber); +-#endif ++ if (strerror_r(errorNumber, buf, bufSize) != 0) ++ snprintf(buf, bufSize, "unknown error %i", errorNumber); ++ p = buf; ++#endif /* defined __GLIBC__ */ + ASSERT(p != NULL); + return p; + } +-- +2.25.1 + |