Changeset 270013 in webkit


Ignore:
Timestamp:
Nov 18, 2020 8:00:18 PM (3 years ago)
Author:
Yousuke.Kimoto@sony.com
Message:

[WTF] Fix a condition to check if statvfs() succeeds in getVolumeFreeSpace()
https://bugs.webkit.org/show_bug.cgi?id=219138

Reviewed by Alexey Proskuryakov.

statvfs() returns Zero on success but getVolumeFreeSpace() treats a non Zero value
as a succes case. The condition is oppsite to the spec of statvfs().

  • wtf/posix/FileSystemPOSIX.cpp:
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r269998 r270013  
     12020-11-18  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>
     2
     3        [WTF] Fix a condition to check if statvfs() succeeds in getVolumeFreeSpace()
     4        https://bugs.webkit.org/show_bug.cgi?id=219138
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        statvfs() returns Zero on success but getVolumeFreeSpace() treats a non Zero value
     9        as a succes case. The condition is oppsite to the spec of statvfs().
     10
     11        * wtf/posix/FileSystemPOSIX.cpp:
     12
    1132020-11-17  Yusuke Suzuki  <ysuzuki@apple.com>
    214
  • trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp

    r264286 r270013  
    436436{
    437437    struct statvfs fileSystemStat;
    438     if (statvfs(fileSystemRepresentation(path).data(), &fileSystemStat)) {
     438    if (!statvfs(fileSystemRepresentation(path).data(), &fileSystemStat)) {
    439439        freeSpace = fileSystemStat.f_bavail * fileSystemStat.f_frsize;
    440440        return true;
Note: See TracChangeset for help on using the changeset viewer.