]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source file changes that are not applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Fri, 23 Mar 2018 22:05:36 +0000 (15:05 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 23 Mar 2018 22:05:36 +0000 (15:05 -0700)
open-vm-tools/lib/file/fileTemp.c
open-vm-tools/lib/include/err.h
open-vm-tools/lib/include/unicodeBase.h

index ae85dbe61400d1a53338576eebb24e39148d3c64..78b1f1781dbf4fc4f4f97bb75f6d5a75dc1e1966 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -186,9 +186,9 @@ FileMakeTempEx2Work(const char *dir,                              // IN:
       }
 
       if (errno != EEXIST) {
-         Log(LGPFX" Failed to create temporary %s \"%s\": %s.\n",
+         Log(LGPFX" Failed to create temporary %s \"%s\", errno: %d.\n",
              createTempFile ? "file" : "directory",
-             path, Err_Errno2String(errno));
+             path, errno);
          goto exit;
       }
    }
index 651fc792651ac9afafbd1b701459467bc0198972..b692db43e1a2e777befc52ee2e19b1824f2b2ed0 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2004-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -29,9 +29,7 @@
 #define INCLUDE_ALLOW_VMCORE
 #include "includeCheck.h"
 
-#if !defined(_WIN32)
 #include <errno.h>
-#endif
 #include "vm_basic_defs.h"
 
 #if defined(__cplusplus)
@@ -123,11 +121,21 @@ char *Err_SanitizeMessage(const char *msg);
  *----------------------------------------------------------------------
  */
 
+#if defined(_WIN32)
+#define WITH_ERRNO(e, body) do { \
+      Err_Number e = Err_Errno(); \
+      int __win__##e = errno; \
+      body; \
+      Err_SetErrno(e); \
+      errno = __win__##e; \
+   } while (0)
+#else
 #define WITH_ERRNO(e, body) do { \
       Err_Number e = Err_Errno(); \
       body; \
       Err_SetErrno(e); \
-   } while (FALSE)
+   } while (0)
+#endif
 
 #if defined(__cplusplus)
 }  // extern "C"
index 1c2b0efaaa0d50b6fa6da5b38d282dad88a618a1..b79c6c858f665c7678646f186b97543268bb7323 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2007-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2007-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -348,7 +348,11 @@ const char *Unicode_GetStatic(const char *asciiBytes,
  */
 #if defined(_WIN32)
    #define UNICODE_GET_UTF16(s)     Unicode_GetAllocUTF16(s)
-   #define UNICODE_RELEASE_UTF16(s) free((utf16_t *)s)
+   #define UNICODE_RELEASE_UTF16(s) do { \
+         int err = errno; \
+         free((utf16_t *)s); \
+         errno = err; \
+      } while (0)
 #endif
 
 #if defined(__cplusplus)