libreboot-utils: simplify random tmpdir namegen

generalise it in rand.c because this logic will
be useful for other programs in the future.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-29 09:10:57 +01:00
parent 45edcf33f7
commit c2a70b7de0
6 changed files with 57 additions and 82 deletions
-14
View File
@@ -537,20 +537,6 @@ try_err(int loop_err, int errval)
return -1;
}
void
free_and_set_null(char **buf)
{
if (buf == NULL)
err_exit(EFAULT,
"null ptr (to ptr for freeing) in free_and_set_null");
if (*buf == NULL)
return;
free(*buf);
*buf = NULL;
}
void
open_on_eintr(const char *path,
int *fd, int flags, mode_t mode,