From 13ecbeefe62880fa480e8604e7399c6911bddd34 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 7 Aug 2026 03:16:55 +0000 Subject: [PATCH 19/38] disk (BSD/Apple): skip st_birthtimespec lookup before macOS 10.6 Ported from https://github.com/macos-powerpc/powerpc-ports/blob/main/sysutils/fastfetch/files/0011-disk_bsd-no-support-for-creation-time-on-ppc.patch --- src/detection/disk/disk_bsd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/disk/disk_bsd.c b/src/detection/disk/disk_bsd.c index aaa69b294..0f1fae849 100644 --- a/src/detection/disk/disk_bsd.c +++ b/src/detection/disk/disk_bsd.c @@ -79,6 +79,7 @@ static void detectFsInfo(struct statfs* fs, FFDisk* disk) { #include #include + #include #ifndef MAC_OS_X_VERSION_10_15 #define MNT_REMOVABLE 0x00000200 @@ -202,7 +203,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks) { #ifdef __OpenBSD__ #define st_birthtimespec __st_birthtim #endif -#ifndef __DragonFly__ +#if !defined(__DragonFly__) && !(defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)) struct stat st; if (stat(fs->f_mntonname, &st) == 0 && st.st_birthtimespec.tv_sec > 0) { disk->createTime = (uint64_t) (((uint64_t) st.st_birthtimespec.tv_sec * 1000) + ((uint64_t) st.st_birthtimespec.tv_nsec / 1000000)); -- 2.43.0