]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Tue, 28 Jun 2011 18:32:46 +0000 (11:32 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 28 Jun 2011 18:32:46 +0000 (11:32 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/err/errPosix.c
open-vm-tools/lib/include/err.h

index be5cfb97370bff21adf1d87f40b95cb157998497..73302a8cb6784269c62eb29c980f14d1b5f71044 100644 (file)
  *
  */
 
+#if defined __linux__
+/* Force GNU strerror_r prototype instead of Posix prototype */
+#  define _GNU_SOURCE
+#endif
+
 #include <errno.h>
 #include <string.h>
 #include <locale.h>
@@ -66,54 +71,3 @@ ErrErrno2String(Err_Number errorNumber, // IN
    ASSERT(p != NULL);
    return p;
 }
-
-
-/*
- *----------------------------------------------------------------------
- *
- * Err_Errno2LocalString --
- *
- *      Returns a localized string in UTF-8 that corresponds to the
- *     passed error number.
- *
- *     XXX doesn't actually work
- *
- * Results:
- *      Allocated error message string, caller must free.
- *     NULL on failure.
- *      
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-char *
-Err_Errno2LocalString(Err_Number errorNumber) // IN
-{
-   /*
-    * XXX The version of glibc (2.2.x) we use doesn't support
-    * uselocal() or strerror_l(), and we can't set LC_MESSAGES
-    * globally, so we can't implement this function.
-    * Instead, we return NULL and the upper level code
-    * (Msg_LocalizeList1) generates some sort of message.
-    * We can't do that here because it would require using
-    * Msg_Format, which is a layer violation (and a linking
-    * problem).
-    */
-
-#if 0
-   // XXX need to cache newLocale if we ever actually use this code
-   locale_t newLocale = newlocale(1 << LC_MESSAGES, NULL, NULL);
-   locale_t oldLocale = uselocale(newLocale);
-   char buf[2048];
-   char *p;
-
-   p = strerror_r(errorNumber, buf, sizeof buf);
-   ASSERT_NOT_IMPLEMENTED(p != NULL);
-   uselocale(oldLocale);
-   return Util_SafeStrdup(p);
-#else
-   return NULL;
-#endif
-}
index 0a9f6f0200b2a0021eeca42da35e290981f80535..5614c5ef48dda1c76eab81a7bb92c915995e42e1 100644 (file)
@@ -56,8 +56,9 @@ Err_Number Err_String2Errno(const char *string);
 Err_Number Err_String2ErrnoDebug(const char *string);
 #endif
 
-char *Err_Errno2LocalString(Err_Number errorNumber);
-
+#if defined(_WIN32)
+char *Err_SanitizeMessage(const char *msg);
+#endif
 
 /*
  *----------------------------------------------------------------------