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 <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-04-02 22:15:58 +01:00
parent fc3c7b9c3e
commit f055809c17
+2 -1
View File
@@ -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);