]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/file: remove dead code
authorVMware, Inc <>
Thu, 24 Feb 2011 22:45:50 +0000 (14:45 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 24 Feb 2011 22:45:50 +0000 (14:45 -0800)
I see dead code.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/file/fileLockPosix.c
open-vm-tools/lib/file/fileLockPrimitive.c
open-vm-tools/lib/include/fileLock.h

index 04a3d0a2566222ed6caa6fbcb80f5e1ad273f8b7..f20990e001dcb5c30902b83e3fa988828a0ab4a1 100644 (file)
@@ -1155,47 +1155,6 @@ FileLock_Unlock(const FileLockToken *lockToken)  // IN:
    return FileUnlockIntrinsic((FileLockToken *) lockToken);
 }
 
-
-/*
- *----------------------------------------------------------------------
- *
- * FileLock_DeleteFileVMX --
- *
- *      The VMX file delete primitive.
- *
- * Results:
- *      0       unlocked
- *      >0      errno
- *
- * Side effects:
- *      Changes the host file system.
- *
- * Note:
- *      THIS IS A HORRIBLE HACK AND NEEDS TO BE REMOVED ASAP!!!
- *
- *----------------------------------------------------------------------
- */
-
-int
-FileLock_DeleteFileVMX(ConstUnicode filePath)  // IN:
-{
-   int err;
-   Unicode normalizedPath;
-
-   ASSERT(filePath);
-
-   normalizedPath = FileLockNormalizePath(filePath);
-   if (normalizedPath == NULL) {
-      err = EINVAL;
-   } else {
-      err = FileLockHackVMX(normalizedPath);
-
-      Unicode_Free(normalizedPath);
-   }
-
-   return err;
-}
-
 #else
 
 /*
index 41a8d5b8245c0ecee4e8efa1944f3fccc0f19e34..b5bbc16698417af67548377d6fd379f0a9e82f8e 100644 (file)
@@ -1734,121 +1734,3 @@ FileLock_TokenPathName(const FileLockToken *lockToken)  // IN:
 
    return Unicode_Duplicate(lockToken->pathName);
 }
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * ScannerVMX --
- *
- *      VMX hack scanner
- *
- * Results:
- *      0       success
- *      > 0     error (errno)
- *
- * Side effects:
- *      None.
- *
- *-----------------------------------------------------------------------------
- */
-
-static int
-ScannerVMX(ConstUnicode lockDir,      // IN:
-           ConstUnicode fileName,     // IN:
-           LockValues *memberValues,  // IN:
-           LockValues *myValues)      // IN/OUT:
-{
-   ASSERT(lockDir);
-   ASSERT(fileName);
-
-   myValues->lamportNumber++;
-
-   return 0;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * FileLockHackVMX --
- *
- *      The VMX file delete primitive.
- *
- * Results:
- *      0       unlocked
- *      > 0     errno
- *
- * Side effects:
- *      Changes the host file system.
- *
- * Note:
- *      THIS IS A HORRIBLE HACK AND NEEDS TO BE REMOVED ASAP!!!
- *
- *----------------------------------------------------------------------
- */
-
-int
-FileLockHackVMX(ConstUnicode pathName)  // IN:
-{
-   int err;
-   LockValues myValues;
-
-   Unicode lockDir = NULL;
-   Unicode entryFilePath = NULL;
-   Unicode memberFilePath = NULL;
-   Unicode entryDirectory = NULL;
-
-   ASSERT(pathName);
-
-   /* first the locking directory path name */
-   lockDir = Unicode_Append(pathName, FILELOCK_SUFFIX);
-
-   /* establish our values */
-   myValues.machineID = (char *) FileLockGetMachineID(); // don't free this!
-   myValues.executionID = FileLockGetExecutionID();      // free this!
-   myValues.locationChecksum = FileLockLocationChecksum(lockDir); // free this!
-   myValues.lamportNumber = 0;
-   myValues.memberName = NULL;
-
-   LOG(1, ("%s on %s (%s, %s).\n", __FUNCTION__, UTF8(pathName),
-       myValues.machineID, myValues.executionID));
-
-   err = CreateEntryDirectory(lockDir, &entryDirectory, &entryFilePath,
-                              &memberFilePath, &myValues.memberName);
-
-   if (err != 0) {
-      goto bail;
-   }
-
-   /* Scan the lock directory */
-   err = Scanner(lockDir, ScannerVMX, &myValues, FALSE);
-
-   if (err == 0) {
-      /* if no members are valid, clean up */
-      if (myValues.lamportNumber == 1) {
-         FileDeletionRobust(pathName, FALSE);
-      }
-   } else {
-      if (vmx86_debug) {
-         Warning(LGPFX" %s clean-up failure for '%s': %s\n",
-                 __FUNCTION__, UTF8(pathName), strerror(err));
-      }
-   }
-
-   /* clean up */
-   FileRemoveDirectoryRobust(entryDirectory);
-   FileRemoveDirectoryRobust(lockDir);
-
-bail:
-
-   Unicode_Free(lockDir);
-   Unicode_Free(entryDirectory);
-   Unicode_Free(entryFilePath);
-   Unicode_Free(memberFilePath);
-   Unicode_Free(myValues.memberName);
-   free(myValues.locationChecksum);
-   free(myValues.executionID);
-
-   return err;
-}
index 9192e78b3213b5a6cec1e13916130ea1ae2d0b2a..801a147d85c2c24c586abdaf07408506645138d6 100644 (file)
@@ -30,9 +30,6 @@
 
 #include "unicodeTypes.h"
 
-// Horrible hack that exists to please VMX; should be removed ASAP
-int  FileLock_DeleteFileVMX(ConstUnicode filePath);
-
 // The default time, in msec, to wait for a lock before giving up
 #define        FILELOCK_DEFAULT_WAIT 2500