Merge pull request #961 from CvH/vm-gcc6

open-vm-tools: gcc6 compile fix
This commit is contained in:
Christian Hewitt 2016-11-20 06:51:23 +04:00 committed by GitHub
commit 657f586557

View File

@ -0,0 +1,60 @@
From 08726e150faca5b67ff981680e556b908aa806d0 Mon Sep 17 00:00:00 2001
From: Bernd Zeimetz <bernd@bzed.de>
Date: Sat, 17 Sep 2016 11:15:12 +0200
Subject: [PATCH] Make open-vm-tools build with gcc 6.
diff --git a/lib/include/x86cpuid.h b/lib/include/x86cpuid.h
--- a/lib/include/x86cpuid.h
+++ b/lib/include/x86cpuid.h
@@ -909,7 +909,7 @@ FIELD(81E, 0, ECX, 8, 3, NODES_PER_PKG, NA, FALSE)
* Note: The MASK definitions must use some gymnastics to get
* around a warning when shifting left by 32.
*/
-#define VMW_BIT_MASK(shift) (((1 << (shift - 1)) << 1) - 1)
+#define VMW_BIT_MASK(shift) (((1u << (shift - 1)) << 1) - 1)
#define FIELD(lvl, ecxIn, reg, bitpos, size, name, s, c3) \
CPUID_##name##_SHIFT = bitpos, \
diff --git a/libDeployPkg/linuxDeployment.c b/libDeployPkg/linuxDeployment.c
--- a/libDeployPkg/linuxDeployment.c
+++ b/libDeployPkg/linuxDeployment.c
@@ -67,7 +67,6 @@
* Constant definitions
*/
-static const char ENDOFLINEMARKER = '\n';
static const char SPACECHAR = ' ';
static const char TABCHAR = '\t';
static const char QUOTECHAR = '"';
@@ -913,22 +912,28 @@ Deploy(const char* packageName)
deploymentResult = ForkExecAndWaitCommand(command);
free (command);
- if (deploymentResult != 0) {
+ if (deploymentResult != CUST_SUCCESS) {
sLog(log_error, "Customization process returned with error. \n");
sLog(log_debug, "Deployment result = %d \n", deploymentResult);
- if (deploymentResult == CUST_NETWORK_ERROR || deploymentResult == CUST_NIC_ERROR) {
+ if (deploymentResult == CUST_NETWORK_ERROR || deploymentResult == CUST_NIC_ERROR || deploymentResult == CUST_DNS_ERROR) {
// Network specific error in the guest
sLog(log_info, "Setting network error status in vmx. \n");
SetCustomizationStatusInVmx(TOOLSDEPLOYPKG_RUNNING,
GUESTCUST_EVENT_NETWORK_SETUP_FAILED,
NULL);
- } else {
+ } else if (deploymentResult == CUST_GENERIC_ERROR) {
// Generic error in the guest
sLog(log_info, "Setting generic error status in vmx. \n");
SetCustomizationStatusInVmx(TOOLSDEPLOYPKG_RUNNING,
GUESTCUST_EVENT_CUSTOMIZE_FAILED,
NULL);
+ } else {
+ // Unknown error in the guest
+ sLog(log_info, "Setting unknown error status in vmx. \n");
+ SetCustomizationStatusInVmx(TOOLSDEPLOYPKG_RUNNING,
+ GUESTCUST_EVENT_CUSTOMIZE_FAILED,
+ NULL);
}
// Move to ERROR state