]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix i18n symbol violations
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:36 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:36 +0000 (11:23 -0700)
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.

open-vm-tools/lib/include/posix.h
open-vm-tools/lib/misc/posixPosix.c

index fd829657b8c24b10f455d2a2905d4486deb384a8..14fb2eecea2c384705bd30d4cfe7fa0266bfb4b9 100644 (file)
@@ -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
index 8d240988a28dfa095e883290ca849a3d28381162..3c7cabf8832b86b7919c74c1a9a3fef073edc1be 100644 (file)
@@ -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;
 }