From 359c535a05cc70c071ac04ee77ad621936287130 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 12 Nov 2025 20:34:01 +0000 Subject: [PATCH] helpers_fileio.c: fix fsync() check. Both the _POSIX_FSYNC macro and the fsync() declaration are in . The current code works by accident on glibc courtesy of transitive includes, but is broken in Android currently (mistakenly assuming there is no fsync() because _POSIX_FSYNC isn't defined, merely because hasn't been included), and won't compile with Android's C23 addition of call_once() to because _POSIX_FSYNC comes in transitively via but without for the fsync() declaration. Fix all of this by just including the right POSIX header file for both the feature macro and the function declaration. Change-Id: Ifd6eeba56cffabb6a37880c78ea21de4705308b5 Signed-off-by: Elliott Hughes Reviewed-on: https://review.coreboot.org/c/flashrom/+/90015 Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) --- helpers_fileio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers_fileio.c b/helpers_fileio.c index 25fd3d0f4..17fa081e8 100644 --- a/helpers_fileio.c +++ b/helpers_fileio.c @@ -10,6 +10,7 @@ #include #include #include +#include #ifndef __LIBPAYLOAD__ #include