Skip to content

Commit ec8e20e

Browse files
authored
Remove calls to statfs for supporting Privacy Manifests (#12355)
1 parent 90e24d0 commit ec8e20e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Crashlytics/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased
2+
- [changed] Removed calls to statfs in the Crashlytics SDK to comply with Apple Privacy Manifests. This change removes support for collecting Disk Space Free in Crashlytics reports.
3+
14
# 10.16.0
25
- [fixed] Fixed a memory leak regression when generating session events (#11725).
36

Crashlytics/Crashlytics/Components/FIRCLSHost.m

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "Crashlytics/Crashlytics/Components/FIRCLSHost.h"
1616

1717
#include <mach/mach.h>
18-
#include <sys/mount.h>
1918
#include <sys/sysctl.h>
2019

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

182181
void FIRCLSHostWriteDiskUsage(FIRCLSFile* file) {
183-
struct statfs tStats;
184-
185182
FIRCLSFileWriteSectionStart(file, "storage");
186183

187184
FIRCLSFileWriteHashStart(file);
188185

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

194192
FIRCLSFileWriteHashEnd(file);
195193

0 commit comments

Comments
 (0)