From 82cdc4cd91894b7edc46b313d1c03884d0f3a990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 17 Sep 2025 15:37:51 +0800 Subject: [PATCH] Disk (Linux): avoids invalid disk creation times before Linux epoch Prevent fastfetch from printing invalid create date on Android --- src/detection/disk/disk_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index 6a1341c25..d90012601 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -269,7 +269,7 @@ static void detectStats(FFDisk* disk) disk->createTime = 0; #ifdef SYS_statx struct statx stx; - if (syscall(SYS_statx, 0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME)) + if (syscall(SYS_statx, 0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME) && stx.stx_btime.tv_sec > 685065600 /*birth of Linux*/) disk->createTime = (uint64_t)((stx.stx_btime.tv_sec * 1000) + (stx.stx_btime.tv_nsec / 1000000)); #endif