[PATCH] genfio: fix temporary file handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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ä <ville.skytta@xxxxxxxxxxx>
---
 tools/genfio | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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=
-- 
2.25.1




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux