-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
GetDiskUsage
and add flag parsing overload
`ParseInt` was failing on the output of `du` because it is in a format like: "<total num> <filepath>". This version splits that and takes the first portion. We should update this later to not rely on `du`, b/385384942 should encompass that. Returning to the `atoi` implementation was not a good idea for the bytes version, because it was still susceptible to overflow issues. Changed the return value to be a `size_t` instead of a signed number, because the sizes will not (should not?) ever be negative. Added a `GflagsCompatFlag` overload for reading in flags that can be compared to the output of this helper. The `GetDiskUsageGigabytes` will still be used in the upcomign `cvd cache`, while the `*Bytes` version will be used when we sync these changes back to AOSP. Test: use the `cvd_cache` branch and run `cvd cache size`
- Loading branch information
Showing
4 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters