Skip to content

Commit

Permalink
Remove calls to statfs for supporting Privacy Manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
samedson committed Feb 5, 2024
1 parent 90e24d0 commit e4265e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Crashlytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unreleased
- [changed] Removed calls to statfs in the Crashlytics SDK to comply with Apple Privacy Manifests. This change removes support for showing Disk Space Free in the Crashlytics console.

# 10.16.0
- [fixed] Fixed a memory leak regression when generating session events (#11725).

Expand Down
12 changes: 5 additions & 7 deletions Crashlytics/Crashlytics/Components/FIRCLSHost.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "Crashlytics/Crashlytics/Components/FIRCLSHost.h"

#include <mach/mach.h>
#include <sys/mount.h>
#include <sys/sysctl.h>

#import "Crashlytics/Crashlytics/Components/FIRCLSApplication.h"
Expand Down Expand Up @@ -180,16 +179,15 @@ bool FIRCLSHostRecord(FIRCLSFile* file) {
}

void FIRCLSHostWriteDiskUsage(FIRCLSFile* file) {
struct statfs tStats;

FIRCLSFileWriteSectionStart(file, "storage");

FIRCLSFileWriteHashStart(file);

if (statfs(_firclsContext.readonly->host.documentDirectoryPath, &tStats) == 0) {
FIRCLSFileWriteHashEntryUint64(file, "free", tStats.f_bavail * tStats.f_bsize);
FIRCLSFileWriteHashEntryUint64(file, "total", tStats.f_blocks * tStats.f_bsize);
}
// Due to Apple Privacy Manifests, Crashlytics is not collecting
// disk space using statfs. When we find a solution, we can update
// this to actually track disk space correctly.
FIRCLSFileWriteHashEntryUint64(file, "free", 0);
FIRCLSFileWriteHashEntryUint64(file, "total", 0);

FIRCLSFileWriteHashEnd(file);

Expand Down

0 comments on commit e4265e8

Please sign in to comment.