]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Tue, 29 Mar 2011 19:56:39 +0000 (12:56 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 29 Mar 2011 19:56:39 +0000 (12:56 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServer.c

index 820a082b0b5eefc521411b8a81701826d6d7ff1f..15189a1aa2d67a8c5d8e14f648f860cc190b7215 100644 (file)
@@ -205,6 +205,8 @@ static MXUserExclLock *gHgfsSharedFoldersLock = NULL;
 /* List of shared folders nodes. */
 static DblLnkLst_Links gHgfsSharedFoldersList;
 
+static Bool gHgfsInitialized = FALSE;
+
 /*
  * Number of active sessions that support change directory notification. HGFS server
  * needs to maintain up-to-date shared folders list when there is
@@ -3277,6 +3279,7 @@ HgfsServer_InitState(HgfsServerSessionCallbacks **callbackTable,  // IN/OUT: our
       if (Config_GetBool(TRUE, "isolation.tools.hgfs.notify.enable")) {
          gHgfsDirNotifyActive = HgfsNotify_Init() == HGFS_STATUS_SUCCESS;
       }
+      gHgfsInitialized = TRUE;
    } else {
       HgfsServer_ExitState(); // Cleanup partially initialized state
    }
@@ -3308,6 +3311,8 @@ HgfsServer_InitState(HgfsServerSessionCallbacks **callbackTable,  // IN/OUT: our
 void
 HgfsServer_ExitState(void)
 {
+   gHgfsInitialized = FALSE;
+
    if (gHgfsDirNotifyActive) {
       HgfsNotify_Shutdown();
       gHgfsDirNotifyActive = FALSE;
@@ -3838,6 +3843,10 @@ HgfsServerSessionSendComplete(HgfsPacket *packet,   // IN/OUT: Hgfs packet
 void
 HgfsServer_Quiesce(Bool freeze)
 {
+   if (!gHgfsInitialized) {
+      return;
+   }
+
    if (freeze) {
       /* Suspend background activity. */
       if (gHgfsDirNotifyActive) {