From: Oliver Kurth Date: Fri, 22 Nov 2019 22:52:31 +0000 (-0800) Subject: Backout previous change to lib/file/filePosix.c. X-Git-Tag: stable-11.1.0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80ca86dc7ae0106ed398237201385e958ff2e9ea;p=thirdparty%2Fopen-vm-tools.git Backout previous change to lib/file/filePosix.c. --- diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index d6b7f7704..31e344087 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -992,7 +992,7 @@ File_SetFilePermissions(const char *pathName, // IN: *----------------------------------------------------------------------------- */ -Bool +static Bool FilePosixGetParent(char **canPath) // IN/OUT: Canonical file path { char *pathName; @@ -1049,7 +1049,6 @@ File_GetParent(char **canPath) // IN/OUT: Canonical file path } -#if !defined(__APPLE__) || TARGET_OS_IPHONE /* *---------------------------------------------------------------------- * @@ -1141,7 +1140,6 @@ File_GetFreeSpace(const char *pathName, // IN: File name return ret; } -#endif #if defined(VMX86_SERVER) @@ -1624,7 +1622,25 @@ File_SupportsOptimisticLock(const char *pathName) // IN: uint64 File_GetCapacity(const char *pathName) // IN: Path name { - return File_GetFreeSpace(pathName, FALSE); + uint64 ret; + char *fullPath; + struct statfs statfsbuf; + + fullPath = File_FullPath(pathName); + if (fullPath == NULL) { + return -1; + } + + if (FileGetStats(fullPath, FALSE, &statfsbuf)) { + ret = (uint64) statfsbuf.f_blocks * statfsbuf.f_bsize; + } else { + Warning(LGPFX" %s: Couldn't statfs\n", __func__); + ret = -1; + } + + Posix_Free(fullPath); + + return ret; }