Bug 782351 - Device Storage - Expose sdcard/volume state flag on stat result followup. If fetching the available disk space fails (due to a path not existing), return zero bytes available. r=khuey

This commit is contained in:
Doug Turner 2012-08-26 21:34:04 -07:00
parent d51291d281
commit a19ad5cd0d

View File

@ -309,12 +309,10 @@ DeviceStorageRequestParent::StatFileEvent::CancelableRun()
nsCOMPtr<nsIRunnable> r;
uint64_t diskUsage = DeviceStorageFile::DirectoryDiskUsage(mFile->mFile);
int64_t freeSpace = 0;
int64_t freeSpace;
nsresult rv = mFile->mFile->GetDiskSpaceAvailable(&freeSpace);
if (NS_FAILED(rv)) {
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_UNKNOWN);
NS_DispatchToMainThread(r);
return NS_OK;
freeSpace = 0;
}
r = new PostStatResultEvent(mParent, diskUsage, freeSpace);