From f055809c17a8a29d9192b79a8fe0a0c0bc1660a0 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 2 Apr 2026 22:15:58 +0100 Subject: lbutils/file: only override EEXIST if not set in the linux fast path, we are universally overriding errno with EEXIST, which pollutes errno in case of debugging under fault condition. this is inconsistent with posix and also leah. Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/mkhtemp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c index 4d511892..69e9f59d 100644 --- a/util/libreboot-utils/lib/mkhtemp.c +++ b/util/libreboot-utils/lib/mkhtemp.c @@ -717,7 +717,8 @@ mkhtemp_tmpfile_linux(int dirfd, goto out; } - errno = EEXIST; + if (!errno) + errno = EEXIST; err: if (linked) (void) unlinkat(dirfd, fname_copy, 0); -- cgit v1.2.1