summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-24 03:15:19 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-24 03:15:19 +0000
commit8b8a5635c3f412183f16abc368019bae79f7857f (patch)
tree66fa9ed138cab16187a297b0a84c75206bf0c983
parent2c21a04741eed260570c7ed3ded08c639e65a689 (diff)
add comment about mkhtemp calling convention
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/libreboot-utils/lib/mkhtemp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c
index e1ca0a10..84723a08 100644
--- a/util/libreboot-utils/lib/mkhtemp.c
+++ b/util/libreboot-utils/lib/mkhtemp.c
@@ -39,6 +39,21 @@ new_tmpdir(int *fd, char **path)
return new_tmp_common(fd, path, MKHTEMP_DIR);
}
+/* WARNING:
+ * on error, *path (at **path) may be
+ NULL, or if the error pertains to
+ an actual TMPDIR, set. if set, it
+ will be using *static* memory and
+ must not be freed. on success,
+ a pointer to heap memory is set
+ instead.
+ * see:
+ * env_tmpdir()
+ * this is for error reports if e.g.
+ * TMPDIR isn't found (but is set)
+ * if TMPDIR isn't set, it will
+ * default to /tmp or /var/tmp
+ */
int
new_tmp_common(int *fd, char **path, int type)
{