]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Soft power ops: changes for Mac OS X support.
authorVMware, Inc <>
Thu, 17 Jun 2010 21:56:08 +0000 (14:56 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 21:56:08 +0000 (14:56 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/guestApp/guestApp.c
open-vm-tools/scripts/common/statechange.sh

index 5c04f13bae61914500ec9ba15c8a99d2885e62c9..ce06591df29a661070aae1a7b211eed4a9dbc606 100644 (file)
@@ -66,14 +66,14 @@ extern "C" {
  * is the hardcoded value below. For Windows, it is
  * determined dynamically in GuestApp_GetInstallPath(),
  * so the empty string here is just for completeness.
- * XXX. Whoever does the Mac port should do something
- * intelligent for that platform as well.
  */
 
-#if defined(_WIN32)
-#define GUESTAPP_TOOLS_INSTALL_PATH ""
+#if defined _WIN32
+#   define GUESTAPP_TOOLS_INSTALL_PATH ""
+#elif defined __APPLE__
+#   define GUESTAPP_TOOLS_INSTALL_PATH "/Library/Application Support/VMware Tools"
 #else
-#define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools"
+#   define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools"
 #endif
 
 /*
index 8897a61ecd61eed111ea1e7b7fff8fecf12f60b8..d5840caa3bd970ddc1d534284faf9730ddbfc513 100644 (file)
 # in other words, `basename "$0"` might be poweron-vm-default.
 #
 # Handy reference/shorthand used in this doc/scripts:
-#    toolsConfDir  ::= Depends on platform and installation settings.  Likely
+#    TOOLS_CONFDIR ::= Depends on platform and installation settings.  Likely
 #                      "/etc/vmware-tools" or
 #                      "/Library/Application Support/VMware Tools"
 #    powerOp       ::= One of "poweron-vm", "poweroff-vm", "suspend-vm", and
 #                      "resume-vm".
-#    vmwScriptDir  ::= $toolsConfDir/scripts/vmware
-#    userScriptDir ::= $toolsConfDir/scripts/${powerOp}-default.d
+#    vmwScriptDir  ::= $TOOLS_CONFDIR/scripts/vmware
+#    userScriptDir ::= $TOOLS_CONFDIR/scripts/${powerOp}-default.d
 #
 # End users may install scripts of their own under $userScriptDir.  They
 # are executed in alphabetical order with "$powerOp" as the only argument.
 echo `date` ": Executing '$0'"
 
 # See above.
-toolsConfDir=`dirname "$0"`
+TOOLS_CONFDIR=`dirname "$0"`
+export TOOLS_CONFDIR
 
 # Pull in subroutines like Panic.
-. "$toolsConfDir"/statechange.subr
+. "$TOOLS_CONFDIR"/statechange.subr
 
 
 #
@@ -110,8 +111,8 @@ main() {
    powerOp=`basename "$0" | sed 's,-default,,'`
    exitCode=0
 
-   vmwScriptDir="$toolsConfDir/scripts/vmware"
-   userScriptDir="$toolsConfDir/scripts/${powerOp}-default.d"
+   vmwScriptDir="$TOOLS_CONFDIR/scripts/vmware"
+   userScriptDir="$TOOLS_CONFDIR/scripts/${powerOp}-default.d"
 
    case "$powerOp" in
       poweron-vm|resume-vm)