From: VMware, Inc <> Date: Thu, 24 Feb 2011 22:45:50 +0000 (-0800) Subject: lib/file: remove dead code X-Git-Tag: 2011.02.23-368700~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d40a9f5b6ffb32d758e432cd322e2a21ac80cb1;p=thirdparty%2Fopen-vm-tools.git lib/file: remove dead code I see dead code. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/file/fileLockPosix.c b/open-vm-tools/lib/file/fileLockPosix.c index 04a3d0a25..f20990e00 100644 --- a/open-vm-tools/lib/file/fileLockPosix.c +++ b/open-vm-tools/lib/file/fileLockPosix.c @@ -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 /* diff --git a/open-vm-tools/lib/file/fileLockPrimitive.c b/open-vm-tools/lib/file/fileLockPrimitive.c index 41a8d5b82..b5bbc1669 100644 --- a/open-vm-tools/lib/file/fileLockPrimitive.c +++ b/open-vm-tools/lib/file/fileLockPrimitive.c @@ -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; -} diff --git a/open-vm-tools/lib/include/fileLock.h b/open-vm-tools/lib/include/fileLock.h index 9192e78b3..801a147d8 100644 --- a/open-vm-tools/lib/include/fileLock.h +++ b/open-vm-tools/lib/include/fileLock.h @@ -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