]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in file.c File_GetSizeEx() to be 64 bit compatible and treat the
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:19 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:19 +0000 (11:23 -0700)
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.

open-vm-tools/lib/file/file.c
open-vm-tools/lib/include/loglevel_user.h

index 3799041ca02787c9fdc5e58ce4d06794e751cfec..c55d1ae460abd0b689a39349628d61343278e47b 100644 (file)
@@ -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;
       }
    }
index 8cbbe032982fb07069dddfe00163a6dcc9b28f00..037fa35f19f590c1fc4ce8badd3e408bb1eae590 100644 (file)
    LOGLEVEL_VAR(efivarstore), \
    LOGLEVEL_VAR(toolsIso), \
    LOGLEVEL_VAR(toolsversion), \
-   LOGLEVEL_VAR(vmva)
+   LOGLEVEL_VAR(vmva), \
+   LOGLEVEL_VAR(udpfec)    /* lib/udpfec */
 
    /* end of list */