#define CONFNAME_MAX_CHANNEL_ATTEMPTS "maxChannelAttempts"
-#if defined(_WIN32)
+#if defined(GLOBALCONFIG_SUPPORTED)
/*
* The state of the global conf module.
*/
#endif
}
-#if defined(_WIN32)
+#if defined(GLOBALCONFIG_SUPPORTED)
if (GlobalConfig_Start(&state->ctx)) {
g_info("%s: Successfully started global config module.",
__FUNCTION__);
gboolean first = state->ctx.config == NULL;
gboolean loaded;
-#if defined(_WIN32)
+#if defined(GLOBALCONFIG_SUPPORTED)
gboolean globalConfLoaded = FALSE;
if (gGlobalConfStarted) {
&state->ctx.config,
&state->configMtime);
-#if defined(_WIN32)
+#if defined(GLOBALCONFIG_SUPPORTED)
if (loaded || globalConfLoaded) {
gboolean configUpdated = VMTools_AddConfig(state->globalConfig,
state->ctx.config);
/*********************************************************
- * Copyright (C) 2008-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2021 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
#include <glib-object.h>
#include <gmodule.h>
#include <time.h>
+#if defined(_WIN32)
+/* Need this header for GLOBALCONFIG_SUPPORTED definition.*/
+#include "globalConfig.h"
+#endif
#include "vmware/tools/plugin.h"
#include "vmware/tools/rpcdebug.h"
gchar *name;
gchar *configFile;
time_t configMtime;
-#if defined(_WIN32)
+#if defined(GLOBALCONFIG_SUPPORTED)
GKeyFile *globalConfig;
time_t globalConfigMtime;
#endif
/*********************************************************
- * Copyright (C) 2008-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2021 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
(defined(__linux__) && !defined(USERWORLD))
{ "gueststore", GuestStore_Command, TRUE, FALSE, GuestStore_Help},
#endif
-#if defined(_WIN32)
+#if defined(GLOBALCONFIG_SUPPORTED)
{ "globalconf", GlobalConf_Command, TRUE, TRUE, GlobalConf_Help},
#endif
{ "logging", Logging_Command, TRUE, TRUE, Logging_Help},
setlocale(LC_ALL, "");
VMTools_LoadConfig(NULL, G_KEY_FILE_NONE, &conf, NULL);
-#if defined(_WIN32)
- if (GlobalConfig_GetEnabled(conf)) {
- GKeyFile *globalConf = NULL;
- if (GlobalConfig_LoadConfig(&globalConf, NULL)) {
- VMTools_AddConfig(globalConf, conf);
- g_key_file_free(globalConf);
- }
- }
-#endif
+ TOOLBOXCMD_LOAD_GLOBALCONFIG(conf)
VMTools_ConfigLogging("toolboxcmd", conf, FALSE, FALSE);
VMTools_BindTextDomain(VMW_TEXT_DOMAIN, NULL, NULL);
/*********************************************************
- * Copyright (C) 2008-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2021 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
#include <string.h>
#ifdef _WIN32
# include "getoptwin32.h"
+# include "globalConfig.h"
#else
# include <getopt.h>
# include <sysexits.h>
DECLARE_COMMAND(GlobalConf)
#endif
+#if defined(GLOBALCONFIG_SUPPORTED)
+
+#define TOOLBOXCMD_LOAD_GLOBALCONFIG(conf) \
+ { \
+ if (GlobalConfig_GetEnabled(conf)) { \
+ GKeyFile *__globalConf = NULL; \
+ if (GlobalConfig_LoadConfig(&__globalConf, NULL)) { \
+ VMTools_AddConfig(__globalConf, conf); \
+ g_key_file_free(__globalConf); \
+ } \
+ } \
+ }
+#else
+
+#define TOOLBOXCMD_LOAD_GLOBALCONFIG(conf)
+
+#endif
+
#endif /*_TOOLBOX_CMD_H_*/
/*********************************************************
- * Copyright (C) 2016,2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2016,2020-2021 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
#include "conf.h"
#include "toolboxCmdInt.h"
-#if defined(_WIN32)
-#include "globalConfig.h"
-#endif
#include "vmware/tools/i18n.h"
#include "vmware/tools/utils.h"
#include "vmware/tools/log.h"
NULL);
if (confDict) {
-#if defined(_WIN32)
- if (GlobalConfig_GetEnabled(confDict)) {
- GKeyFile *globalConf = NULL;
- if (GlobalConfig_LoadConfig(&globalConf, NULL)) {
- VMTools_AddConfig(globalConf, confDict);
- g_key_file_free(globalConf);
- }
- }
-#endif
+ TOOLBOXCMD_LOAD_GLOBALCONFIG(confDict)
value = g_key_file_get_string(confDict, section,
key, NULL);
} else {
/*********************************************************
- * Copyright (C) 2015-2016,2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2015-2016,2020-2021 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
#include "conf.h"
#include "toolboxCmdInt.h"
-#if defined(_WIN32)
-#include "globalConfig.h"
-#endif
#include "vmware/tools/i18n.h"
#include "vmware/tools/utils.h"
#include "vmware/tools/log.h"
confDict = g_key_file_new();
}
-#if defined(_WIN32)
- if (GlobalConfig_GetEnabled(confDict)) {
- GKeyFile *globalConf = NULL;
- if (GlobalConfig_LoadConfig(&globalConf, NULL)) {
- VMTools_AddConfig(globalConf, confDict);
- g_key_file_free(globalConf);
- }
- }
-#endif
+ TOOLBOXCMD_LOAD_GLOBALCONFIG(confDict)
confName = g_strdup_printf("%s.level", service);
/*********************************************************
- * Copyright (C) 2008-2016,2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2016,2020-2021 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
#include "guestApp.h"
#include "system.h"
#include "toolboxCmdInt.h"
-#if defined(_WIN32)
-#include "globalConfig.h"
-#endif
#include "vmware/tools/i18n.h"
#include "vmware/tools/utils.h"
}
confDict = LoadConfFile();
-#if defined(_WIN32)
- if (GlobalConfig_GetEnabled(confDict)) {
- GKeyFile *globalConf = NULL;
- if (GlobalConfig_LoadConfig(&globalConf, NULL)) {
- VMTools_AddConfig(globalConf, confDict);
- g_key_file_free(globalConf);
- }
- }
-#endif
+ TOOLBOXCMD_LOAD_GLOBALCONFIG(confDict)
switch (type) {
case Current: