]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix misc. issues in appinfo plugin source.
authorOliver Kurth <okurth@vmware.com>
Fri, 12 Jun 2020 03:43:21 +0000 (20:43 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 12 Jun 2020 03:43:21 +0000 (20:43 -0700)
Used the proper @param and @return statements in the
function documentation for AppInfoServerSetOption.

Re-organized an if code block.

open-vm-tools/services/plugins/appInfo/appInfo.c

index c190c247ece82e8c902c9307ff1bf8a846ef6575..4fe67a66401b1e472516e241a4e36fa89e243aec 100644 (file)
@@ -589,14 +589,18 @@ AppInfoServerShutdown(gpointer src,          // IN
  *
  * AppInfoServerSetOption --
  *
- *      Handle TOOLSOPTION_ENABLE_APPINFO Set_Option callback.
- *
- * Results:
- *      TRUE on success.
- *
- * Side-effects:
- *      None
+ * Handle TOOLSOPTION_ENABLE_APPINFO Set_Option callback.
  *
+ * @param[in]  src      The source object.
+ * @param[in]  ctx      The app context.
+ * @param[in]  option   Option being set.
+ * @param[in]  value    Option value.
+ * @param[in]  plugin   Plugin registration data.
+ *
+ * @return  TRUE  if the specified option is TOOLSOPTION_ENABLE_APPINFO and
+ *                the AppInfo Gather poll loop is reconfigured.
+ *          FALSE if the specified option is not TOOLSOPTION_ENABLE_APPINFO
+ *                or AppInfo Gather poll loop is not reconfigured.
  *----------------------------------------------------------------------------
  */
 
@@ -610,8 +614,8 @@ AppInfoServerSetOption(gpointer src,         // IN
    gboolean retVal = FALSE;
 
    if (strcmp(option, TOOLSOPTION_ENABLE_APPINFO) == 0) {
-      g_debug("Tools set option %s=%s.\n",
-              TOOLSOPTION_ENABLE_APPINFO, value);
+      g_debug("%s: Tools set option %s=%s.\n",
+              __FUNCTION__, TOOLSOPTION_ENABLE_APPINFO, value);
 
       if (strcmp(value, "1") == 0 && !gAppInfoEnabledInHost) {
          gAppInfoEnabledInHost = TRUE;
@@ -620,12 +624,12 @@ AppInfoServerSetOption(gpointer src,         // IN
          gAppInfoEnabledInHost = FALSE;
          retVal = TRUE;
       }
-   }
 
-   if (retVal) {
-      g_info("%s: State of AppInfo is changed to '%s' at host side.\n",
-             __FUNCTION__, gAppInfoEnabledInHost ? "enabled" : "disabled");
-      TweakGatherLoop(ctx, TRUE);
+      if (retVal) {
+         g_info("%s: State of AppInfo is changed to '%s' at host side.\n",
+                __FUNCTION__, gAppInfoEnabledInHost ? "enabled" : "disabled");
+         TweakGatherLoop(ctx, TRUE);
+      }
    }
 
    return retVal;