From: VMware, Inc <> Date: Mon, 22 Aug 2011 19:48:33 +0000 (-0700) Subject: Fix Mac OS tools. X-Git-Tag: 2011.08.21-471295~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd64dac60be57e70bb7a15a600ddd0eae9432444;p=thirdparty%2Fopen-vm-tools.git Fix Mac OS tools. Two fixes: . Enable Hostinfo_TouchBackDoor for Mac OS. The comment doesn't seem to be true, at least not anymore. . On Mac OS, create the glib main loop with the "running" flag set. Since we don't call g_main_loop_run() on Mac OS, that's the only way to signal that the loop is running. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/misc/hostinfoHV.c b/open-vm-tools/lib/misc/hostinfoHV.c index 356eb4583..9cbad2fd8 100644 --- a/open-vm-tools/lib/misc/hostinfoHV.c +++ b/open-vm-tools/lib/misc/hostinfoHV.c @@ -489,7 +489,7 @@ Hostinfo_VCPUInfoBackdoor(unsigned bit) /* *---------------------------------------------------------------------- * - * Hostinfo_TouchBackDoor -- + * Hostinfo_TouchBackDoor -- * * Access the backdoor. This is used to determine if we are * running in a VM or on a physical host. On a physical host @@ -505,7 +505,7 @@ Hostinfo_VCPUInfoBackdoor(unsigned bit) * if not. * * Side effects: - * Exception if not in a VM. + * Exception if not in a VM. * *---------------------------------------------------------------------- */ @@ -513,13 +513,7 @@ Hostinfo_VCPUInfoBackdoor(unsigned bit) Bool Hostinfo_TouchBackDoor(void) { - /* - * XXX: This can cause Apple's Crash Reporter to erroneously display - * a crash, even though the process has caught the SIGILL and handled - * it. - */ - -#if !defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__)) +#if defined(__i386__) || defined(__x86_64__) uint32 eax; uint32 ebx; uint32 ecx; diff --git a/open-vm-tools/services/vmtoolsd/mainLoop.c b/open-vm-tools/services/vmtoolsd/mainLoop.c index d88cfbe7f..a5738c767 100644 --- a/open-vm-tools/services/vmtoolsd/mainLoop.c +++ b/open-vm-tools/services/vmtoolsd/mainLoop.c @@ -387,7 +387,15 @@ ToolsCore_Setup(ToolsServiceState *state) state->ctx.version = TOOLS_CORE_API_V1; state->ctx.name = state->name; state->ctx.errorCode = EXIT_SUCCESS; +#if defined(__APPLE__) + /* + * Mac OS doesn't use g_main_loop_run(), so need to create the loop as + * "running". + */ + state->ctx.mainLoop = g_main_loop_new(gctx, TRUE); +#else state->ctx.mainLoop = g_main_loop_new(gctx, FALSE); +#endif state->ctx.isVMware = VmCheck_IsVirtualWorld(); g_main_context_unref(gctx);