/*********************************************************
- * 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
}
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;
}
}
/*********************************************************
- * 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
#define INCLUDE_ALLOW_VMCORE
#include "includeCheck.h"
-#if !defined(_WIN32)
#include <errno.h>
-#endif
#include "vm_basic_defs.h"
#if defined(__cplusplus)
*----------------------------------------------------------------------
*/
+#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"
/*********************************************************
- * 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
*/
#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)