mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 18:34:57 +02:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user