From 8b8a5635c3f412183f16abc368019bae79f7857f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 24 Mar 2026 03:15:19 +0000 Subject: add comment about mkhtemp calling convention Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/mkhtemp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'util') 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) { -- cgit v1.2.1