Files
Rainer Müller b015b54a47 afsctool: Fix filesystem detection for APFS
Although still undocumented, the f_type number for APFS has changed once
again in macOS 10.13 High Sierra. Use the filesystem name by string
instead for a more robust detection.

Closes: https://trac.macports.org/ticket/55214
2017-11-07 16:32:26 +01:00

19 lines
646 B
Diff

Upstream-Status: Inappropriate; no canonical upstream exists,
but this is based on https://github.com/RJVB/afsctool/pull/1
--- afsctool.c 2017-11-07 16:00:24.000000000 +0100
+++ afsctool.c 2017-11-07 16:12:20.000000000 +0100
@@ -131,8 +131,11 @@
if (statfs(inFile, &fsInfo) < 0)
return;
- if (fsInfo.f_type != 17)
+ if (strncasecmp(fsInfo.f_fstypename, "hfs", 3) != 0 && strncasecmp(fsInfo.f_fstypename, "apfs", 4) != 0) {
+ fprintf(stderr, "%s: f_fstypename is %s (f_type = %d), but expected \"hfs\" or \"apfs\"\n",
+ inFile, fsInfo.f_fstypename, fsInfo.f_type);
return;
+ }
if (!S_ISREG(inFileInfo->st_mode))
return;