Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Unified Diff: base/sys_info_win.cc

Issue 4003: Fix AmountOfFreeDiskSpace to be able to differentiate an error... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sys_info_posix.cc ('k') | net/disk_cache/mem_backend_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_win.cc
===================================================================
--- base/sys_info_win.cc (revision 2424)
+++ base/sys_info_win.cc (working copy)
@@ -26,16 +26,22 @@
return 0;
}
- return static_cast<int64>(memory_info.ullTotalPhys);
+ int64 rv = static_cast<int64>(memory_info.ullTotalPhys);
+ if (rv < 0)
+ rv = kint64max;
+ return rv;
}
// static
int64 SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) {
ULARGE_INTEGER available, total, free;
if (!GetDiskFreeSpaceExW(path.c_str(), &available, &total, &free)) {
- return 0;
+ return -1;
}
- return static_cast<int64>(available.QuadPart);
+ int64 rv = static_cast<int64>(available.QuadPart);
+ if (rv < 0)
+ rv = kint64max;
+ return rv;
}
} // namespace base
« no previous file with comments | « base/sys_info_posix.cc ('k') | net/disk_cache/mem_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698