[PATCH] 273: don't delete everything if $SCRATCH_MNT isn't set

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

 



The cleanup function is trapped before _require_scratch() is called, and
then expands "rm -rf $SCRATCH_MNT/*" to "rm -rf /*"

Signed-off-by: Bryan Schumaker <bjschuma@xxxxxxxxxx>
---
 273 |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/273 b/273
index 2965132..8889f5a 100755
--- a/273
+++ b/273
@@ -35,7 +35,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
 	cd /
-	rm -rf $SCRATCH_MNT/* $tmp.*
+	if [ ! -z $SCRATCH_DEV ] && [ ! -z $SCRATCH_MNT ];
+	then
+		rm -rf $SCRATCH_MNT
+	fi
+	rm -rf $tmp.*
 	_scratch_unmount
 }
 
-- 
1.7.10

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux