mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: remove tmp files properly
Some tests and common helpers don't properly clean up tmp files and leave them behind in /tmp dir, and these tmp files are accumulating over time. Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
+2
-2
@@ -82,7 +82,7 @@ _scratch_mkfs_xfs()
|
||||
local mkfs_cmd="`_scratch_mkfs_xfs_opts`"
|
||||
local mkfs_filter="sed -e '/less than device physical sector/d' \
|
||||
-e '/switching to logical sector/d'"
|
||||
local tmp=`mktemp`
|
||||
local tmp=`mktemp -u`
|
||||
local mkfs_status
|
||||
|
||||
_scratch_do_mkfs "$mkfs_cmd" "$mkfs_filter" $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
|
||||
@@ -104,7 +104,7 @@ _scratch_mkfs_xfs()
|
||||
# output mkfs stdout and stderr
|
||||
cat $tmp.mkfsstd
|
||||
cat $tmp.mkfserr >&2
|
||||
rm -f $tmp*
|
||||
rm -f $tmp.mkfserr $tmp.mkfsstd
|
||||
|
||||
return $mkfs_status
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user