From: Ville Skyttä Date: Tue, 2 Nov 2021 21:41:00 +0000 (+0200) Subject: genfio: fix temporary file handling X-Git-Tag: fio-3.30~35^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=31952e1d0c86a56a3969f05bb53a20fe018fe189;p=fio.git genfio: fix temporary file handling As a side effect, the template temp file is no longer left behind, as a unique filename is used for it on each run. Use the same method of figuring out the temp dir as in check_status_file(). Signed-off-by: Ville Skyttä --- diff --git a/tools/genfio b/tools/genfio index 8518bbcc..fc7e6e46 100755 --- a/tools/genfio +++ b/tools/genfio @@ -22,7 +22,8 @@ BLK_SIZE= BLOCK_SIZE=4k SEQ=-1 -TEMPLATE=/tmp/template.fio +TEMPLATE=$(mktemp "${TMPDIR:-${TEMP:-/tmp}}/template.fio.XXXXXX") || exit $? +trap 'rm -f "$TEMPLATE"' EXIT OUTFILE= DISKS= PRINTABLE_DISKS=