1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-11-17 13:10:42 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
Elliott Hughes
359c535a05 helpers_fileio.c: fix fsync() check.
Both the _POSIX_FSYNC macro and the fsync() declaration are in
<unistd.h>. 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 <unistd.h> hasn't been included), and won't compile with Android's
C23 addition of call_once() to <stdlib.h> because _POSIX_FSYNC comes in
transitively via <limits.h> but without <unistd.h> 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 <enh@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/90015
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-11-17 00:29:32 +00:00
Anastasia Klimchuk
c09a2f5387 core: Use SPDX in headers
Change-Id: Ic24a54ab520053e49efcba02bd9fa5b8ce69b20a
Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/89956
Reviewed-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2025-11-12 11:30:28 +00:00
Edward O'Callaghan
c9ebfad95f flashrom.c: Move write_buf_to_file() to helpers_fileio.c
Constructing a written file from a buffer is auxiliary
functionality to the core flashrom algorithms. Move
aside to decrease the overall complexity of flashrom.c

BUG=b:242246291
TEST=builds

Change-Id: Ib613e74597d4bdd689043ba93aeb6a87ec80cc14
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66646
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Evan Benn <evanbenn@google.com>
Reviewed-by: Sam McNally <sammc@google.com>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-25 00:25:41 +00:00
Edward O'Callaghan
3c1aa889d8 flashrom.c: Move read_buf_from_file() to helpers_fileio.c
Constructing a buffer from a read file is auxiliary
functionality to the core flashrom algorithms. Move
aside to decrease the overall complexity of flashrom.c

BUG=b:242246291
TEST=builds

Change-Id: Ia6e1eeb876722899defb5b75346d1f22c70bfbd1
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66645
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Evan Benn <evanbenn@google.com>
Reviewed-by: Sam McNally <sammc@google.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-25 00:25:12 +00:00