From: VMware, Inc <> Date: Mon, 26 Jul 2010 19:26:03 +0000 (-0700) Subject: ghi: use native environment from app ctx. X-Git-Tag: 2010.07.25-280253~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcfea968018d0fce362fa9a7ea6b97f031cfa4ec;p=thirdparty%2Fopen-vm-tools.git ghi: use native environment from app ctx. The "environ" variable seems to be a leftover from olden vmware-user days. The ToolsAppCtx struct contains the native environent for plugins to use in vmtoolsd-land. Also add a new line at the end of unity.x to make rpcgen quiet. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationX11.c b/open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationX11.c index 52de51037..433a3d9d0 100644 --- a/open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationX11.c +++ b/open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationX11.c @@ -346,12 +346,11 @@ GHIPlatformIsSupported(void) GHIPlatform * GHIPlatformInit(ToolsAppCtx *ctx) // IN { - extern const char **environ; GHIPlatform *ghip; ghip = Util_SafeCalloc(1, sizeof *ghip); ghip->directoriesTracked = g_array_new(FALSE, FALSE, sizeof(GHIDirectoryWatch)); - ghip->nativeEnviron = System_GetNativeEnviron(environ); + ghip->nativeEnviron = ctx->envp; ghip->appsByWindowExecutable = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); AppUtil_Init(); @@ -512,10 +511,7 @@ GHIPlatformCleanup(GHIPlatform *ghip) // IN GHIPlatformSetMenuTracking(ghip, FALSE); g_array_free(ghip->directoriesTracked, TRUE); ghip->directoriesTracked = NULL; - if (ghip->nativeEnviron) { - System_FreeNativeEnviron(ghip->nativeEnviron); - ghip->nativeEnviron = NULL; - } + ghip->nativeEnviron = NULL; g_hash_table_destroy(ghip->appsByWindowExecutable); free(ghip); } diff --git a/open-vm-tools/services/plugins/unity/unity.x b/open-vm-tools/services/plugins/unity/unity.x index ff9bd9fbd..e9cf3aaa3 100644 --- a/open-vm-tools/services/plugins/unity/unity.x +++ b/open-vm-tools/services/plugins/unity/unity.x @@ -237,4 +237,4 @@ struct UnityMouseWheelV1 union UnityMouseWheel switch (UnityMouseWheelVersion ver) { case UNITY_MOUSE_WHEEL_V1: struct UnityMouseWheelV1 *mouseWheelV1; -} +};