summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-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)
{