From 513365713a01504915a6d20eec08c5039e4c7fd5 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 9 Jun 2026 02:01:29 -0400 Subject: [PATCH] [FixRed] sonybootloader has a glyphcache but no open_pathfmt Change-Id: Iaf8522d4a72f78da26434b60757fe3421a3622f2 --- bootloader/common.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bootloader/common.c b/bootloader/common.c index 07dd8120ed..705441357a 100644 --- a/bootloader/common.c +++ b/bootloader/common.c @@ -165,3 +165,17 @@ int load_raw_firmware(unsigned char* buf, char* firmware, int buffer_size) close(fd); return len; } + +#if (!defined(MISC_H) && CONFIG_PLATFORM & PLATFORM_HOSTED) +/* open but with a builtin printf for assembling the path */ +int open_pathfmt(char *buf, size_t size, int oflag, const char *pathfmt, ...) +{ + va_list ap; + va_start(ap, pathfmt); + vsnprintf(buf, size, pathfmt, ap); + va_end(ap); + if ((oflag & O_PATH) == O_PATH) + return -1; + return open(buf, oflag, 0666); +} +#endif