From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:36 +0000 (-0700) Subject: Fix i18n symbol violations X-Git-Tag: stable-10.2.0~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47c77211f47644e1e999621d3974ebd09af84312;p=thirdparty%2Fopen-vm-tools.git Fix i18n symbol violations Fix some of the illegal symbols that are flagged. Also changed the wrapper for unsetenv to return an int to match the glibc-2.2.2 and later version. Tools build for FreeBSD appears to be using an older libc so it always reports success in that case. --- diff --git a/open-vm-tools/lib/include/posix.h b/open-vm-tools/lib/include/posix.h index fd829657b..14fb2eece 100644 --- a/open-vm-tools/lib/include/posix.h +++ b/open-vm-tools/lib/include/posix.h @@ -168,7 +168,7 @@ int Posix_Execvp(const char *fileName, char *const argVal[]); DIR *Posix_OpenDir(const char *pathName); int Posix_System(const char *command); int Posix_Putenv(char *name); -void Posix_Unsetenv(const char *name); +int Posix_Unsetenv(const char *name); /* * These functions return dynamically allocated stings that have to be diff --git a/open-vm-tools/lib/misc/posixPosix.c b/open-vm-tools/lib/misc/posixPosix.c index 8d240988a..3c7cabf88 100644 --- a/open-vm-tools/lib/misc/posixPosix.c +++ b/open-vm-tools/lib/misc/posixPosix.c @@ -1706,7 +1706,7 @@ exit: * POSIX unsetenv(). * * Results: - * None. + * 0 on success. -1 on error. * * Side effects: * Environment may be changed. @@ -1714,21 +1714,31 @@ exit: *---------------------------------------------------------------------- */ -void +int Posix_Unsetenv(const char *name) // IN: { char *rawName; + int ret; if (!PosixConvertToCurrent(name, &rawName)) { - return; + return -1; } #if defined(sun) - putenv(rawName); -#else + ret = putenv(rawName); +#elif defined(__FreeBSD__) + /* + * Our tools build appears to use an old enough libc version that returns + * void. + */ unsetenv(rawName); + ret = 0; +#else + ret = unsetenv(rawName); #endif Posix_Free(rawName); + + return ret; }