]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
ghi: use native environment from app ctx.
authorVMware, Inc <>
Mon, 26 Jul 2010 19:26:03 +0000 (12:26 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Jul 2010 19:26:03 +0000 (12:26 -0700)
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 <mvanzin@vmware.com>
open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationX11.c
open-vm-tools/services/plugins/unity/unity.x

index 52de510374eb98eb455d7f86c59d171e71fa001b..433a3d9d0360ffbbd7e624e1f5811866f1f4b937 100644 (file)
@@ -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);
 }
index ff9bd9fbd7b13ea93c3ad881c53ba5dc2ed75b99..e9cf3aaa3193d334d290a2a8b74d60fb95a1f57d 100644 (file)
@@ -237,4 +237,4 @@ struct UnityMouseWheelV1
 union UnityMouseWheel switch (UnityMouseWheelVersion ver) {
 case UNITY_MOUSE_WHEEL_V1:
    struct UnityMouseWheelV1 *mouseWheelV1;
-}
+};