diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-20 01:16:23 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-20 01:16:23 +0000 |
commit | 02ee34a9daa91fd125b9f9a48ca56502c8d1d36c (patch) | |
tree | 607ac680d8d8d8b39348d8415677e9813d440737 /base/sys_info_posix.cc | |
parent | c328da8db8cb5c8d9366874c6e23533e9fa82c7e (diff) | |
download | chromium_src-02ee34a9daa91fd125b9f9a48ca56502c8d1d36c.zip chromium_src-02ee34a9daa91fd125b9f9a48ca56502c8d1d36c.tar.gz chromium_src-02ee34a9daa91fd125b9f9a48ca56502c8d1d36c.tar.bz2 |
Fix AmountOfFreeDiskSpace to be able to differentiate an error
from a full disk.
Review URL: http://codereview.chromium.org/4003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info_posix.cc')
-rw-r--r-- | base/sys_info_posix.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc index 541a424..28c8bd6 100644 --- a/base/sys_info_posix.cc +++ b/base/sys_info_posix.cc @@ -65,7 +65,7 @@ int64 SysInfo::AmountOfPhysicalMemory() { int64 SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) { struct statvfs stats; if (statvfs(WideToUTF8(path).c_str(), &stats) != 0) { - return 0; + return -1; } return static_cast<int64>(stats.f_bavail) * stats.f_frsize; } |