From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:19 +0000 (-0700) Subject: Changes in file.c File_GetSizeEx() to be 64 bit compatible and treat the X-Git-Tag: stable-10.2.0~403 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=416e2c5a0d4459ef63d05eb23e514e18532a6baf;p=thirdparty%2Fopen-vm-tools.git Changes in file.c File_GetSizeEx() to be 64 bit compatible and treat the size of temporary file that disappears between the File_ListDirectory() and File_GetSize() calls as size 0. Common header file change; not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/file/file.c b/open-vm-tools/lib/file/file.c index 3799041ca..c55d1ae46 100644 --- a/open-vm-tools/lib/file/file.c +++ b/open-vm-tools/lib/file/file.c @@ -1477,7 +1477,6 @@ File_GetSizeEx(const char *pathName) // IN: { int i; int numFiles; - struct stat sb; int64 totalSize = 0; char **fileList = NULL; @@ -1485,16 +1484,11 @@ File_GetSizeEx(const char *pathName) // IN: return -1; } - if (Posix_Lstat(pathName, &sb) == -1) { - return -1; - } - - if ((sb.st_mode & S_IFMT) != S_IFDIR) { - return sb.st_size; + if (!File_IsDirectory(pathName)) { + return File_GetSize(pathName); } numFiles = File_ListDirectory(pathName, &fileList); - if (numFiles == -1) { return -1; } @@ -1505,10 +1499,7 @@ File_GetSizeEx(const char *pathName) // IN: free(fileName); - if (fileSize == -1) { - totalSize = -1; - break; - } else { + if (fileSize != -1) { totalSize += fileSize; } } diff --git a/open-vm-tools/lib/include/loglevel_user.h b/open-vm-tools/lib/include/loglevel_user.h index 8cbbe0329..037fa35f1 100644 --- a/open-vm-tools/lib/include/loglevel_user.h +++ b/open-vm-tools/lib/include/loglevel_user.h @@ -305,7 +305,8 @@ LOGLEVEL_VAR(efivarstore), \ LOGLEVEL_VAR(toolsIso), \ LOGLEVEL_VAR(toolsversion), \ - LOGLEVEL_VAR(vmva) + LOGLEVEL_VAR(vmva), \ + LOGLEVEL_VAR(udpfec) /* lib/udpfec */ /* end of list */